home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-04-05 | 174.0 KB | 4,445 lines |
-
-
-
-
-
-
-
-
-
-
-
- ┌─┐┌─┐┬ ┬ ─┬─┌ ┐┌─┐┌─┐ ┌─┐┌─┐┌─┐─┬─┌ ┐┌─┐┌─┐┌─┐ ┐ ┌─┐
- │┌┐│ ││ │ │ ││││ ││┌┐ └─┐│ │├─ │ │││├─┤├┬┘├─ └─┐
- └─┘└─┘└─┘└─┘─┴─└┴┘└─┘└─┘ └─┘└─┘└ ┴ └┴┘└ ┘┴└┘└─┘ └─┘
- ──────────────────────────────────────────────────────────────
-
- G∙A∙M∙E - Gaming Applications Made Easy, Version 1.1
- Copyright 1992,93,94 by Lennert Bakker
- All rights reserved
-
-
- "The most complete toolkit available when it comes to
- writing games, demonstrations and educational software!"
-
- ──────────────────────────────────────────────────────────────
-
-
- Table of contents
-
-
-
- Chapter 1: G∙A∙M∙E, an introduction
-
- 1.1 What IS this program?
- 1.2 System requirements
- 1.3 Registering your copy of G∙A∙M∙E
- 1.4 Disclaimer
- 1.5 What's there to come?
- 1.6 Support and distribution
- 1.7 Special thanks must go out to...
-
-
- Chapter 2: Getting started, a quick overview
-
- 2.1 The basic idea...
- 2.2 and my implementation
- 2.3 An example program
-
-
- Chapter 3: The G∙A∙M∙E units, what do they do?
-
- 3.1 TGK_MAIN; The general stuff
- 3.2 TGK_GP; Some graphics-primitives
- 3.3 TGK_IO; User-interaction made easy
- 3.4 TGK_BM; Bitmapping and the like
- 3.5 TGK_SND; For your listening pleasure
- 3.6 TGK_WIN; A Graphical User Interface (GUI)
- 3.7 TGK_3D; Vector graphics take off
- 3.8 TGK_TEXT; Get the message out!
- 3.9 TGK_ANIM; Look mom, it's moving...
- 3.10 TGK_FILE; File handling routines
-
-
- Chapter 4: Utility programs
-
- 4.1 GAMECAP; A screen-capture program
- 4.2 ANIMEDIT; A full-featured animation editor
- 4.3 ROL2GMF; A music-conversion program
- 4.4 GAMEFONT; A font-conversion program
- 4.5 MAKERES; A resource-file creator
-
-
- Chapter 5: G∙A∙M∙E reference manual
-
-
- Appendix A: KeyBoard ScanCodes
-
-
-
-
-
- In silent contemplation:
- (Wat heb je nu geleerd, spelend jongetje?)
-
- What can I say? So now I've been alive for some 20 years
- and I can't help wondering:
-
- "What is it that I've learned?"
-
- I was never made for writing documentation, I guess...
-
-
-
-
-
- A word on dedication:
-
- Hope you don't mind Kai, but I guess I'll dedicate this
- to your sister. So kittenish she is...
-
-
-
-
-
- Someone had something to say about G∙A∙M∙E
- and thus, I quote:
-
- "I recieved your G∙A∙M∙E-program just a few days ago and
- I have really been very impressed! Even though I am a
- novice in vectorgraphics, your toolbox has been of great
- help." -- Leif Nygaard
- Chapter 1: G∙A∙M∙E, an introduction
-
-
- 1.1 What IS this program?
-
- You don't have to be an experienced programmer to create top
- of the notch games, demonstrations or educational programs;
- well, not anymore, that is. Now there's G∙A∙M∙E, a toolkit for
- Turbo Pascal programmers, allowing them to easily create the
- finest software without having to go through the hassle of
- writing all sorts of fast routines in assembly language,
- spending months trying to figure these out.
- Using G∙A∙M∙E, adding these routines is real easy. Simply grab
- a piece of music, load it and have it start playing in the
- background without ever even bothering about it anymore. Draw
- some frames, combine them to form an animation using G∙A∙M∙E's
- animation-editor and have them fly across the screen in full
- glory. G∙A∙M∙E handles all this, while you sit back and watch.
- Have you ever dreamt of writing games that would really knock
- others off their feet? Here's your ticket to ride. Have fun!
-
-
- 1.2 System requirements
-
- This part is really straightforward. If Turbo Pascal works on
- your system, so will G∙A∙M∙E. The only other requirement is
- that your system has to be equipped with a VGA card and moni-
- tor. In addition, if you want to use G∙A∙M∙E's capabilities to
- the fullest, you will need an Adlib or Soundblaster compatible
- soundboard. It is also recommended that you use a 386-based
- machine and Turbo Pascal version 7. This way you will be able
- to run Turbo Pascal in protected mode, thus allowing you to
- compile larger programs from within the Turbo Pascal Integra-
- ted Environment. Of course, if you don't have a 386-machine,
- you could always compile your programs from the commandline.
-
-
- 1.3 Registering your copy of G∙A∙M∙E
-
- G∙A∙M∙E is a shareware product, meaning that if you like this
- program and intend to use it in the future, you will have to
- register your copy. Registering has some major advantages. You
- will recieve the FULL SOURCE code to the product and you will
- be allowed to distribute your own programs created using
- G∙A∙M∙E. There's no such thing as royality-fees and you will
- be absolutely free to use the registered version of G∙A∙M∙E in
- any way you like; you could make a lot of money distributing
- your own homebrewed software... The registration fee is $30 or
- an equivalent in your local currency. Please make your regist-
- ration (international postal money order or local currency)
- payable to:
-
- L.Bakker / G∙A∙M∙E Productions
- Thierenskade 6
- 2282 XT, Rijswijk
- The Netherlands
-
-
- 1.4 Disclaimer
-
- "I (Lennert Bakker), hereby disclaim all warranties relating
- to this software, whether expressed or implied, including but
- not limited to any implied warranties of merchantability and
- fitness for a particular purpose. All such warranties are
- expressly and specifically disclaimed. Neither I, nor anyone
- else who has been involved in the creation, production or
- delivery of this software shall be liable for any indirect,
- consequential, or incidental damages arising out of the use
- or inability to use this software." There is NO warranty,
- not of any kind.
-
-
- 1.5 What's there to come?
-
- Coming up; some of the future plans I have for G∙A∙M∙E:
- I plan on adding support for various other soundboards, such
- as the Gravis Ultrasound, SoundBlaster Pro, Pro Audio Spectrum
- and Adlib Gold. What I need are programming specifications on
- these cards, or better yet an actual soundboard to test all
- these routines on... Does any company out there feel like
- supplying me with one of these cards and having their name
- mentioned here? Also, a really FAST tiling-sytem is in the
- making, allowing you to create games in the line of Commander
- Keen, Duke Nukem or Xargon... Furthermore, loads of changes
- and enhancements will be made; too much to go into right now,
- just find out, in the future. This product will definitely be
- too hot to handle!
-
-
- 1.6 Support and distribution
-
- If you have any questions or comments regarding G∙A∙M∙E, or if
- you would like to obtain the latest version of G∙A∙M∙E, please
- call the official G∙A∙M∙E support- and distribution-site:
-
- ANDROMEDA, Tel. +31-(0)73-571599 - Sysop: Rombout de Backer
- Running on ZyXEL 19k2, Fax, Voice, v32bis & v42bis
- File requests from 08:00-01:00 CET under magic-name GAME
- or login as SUPPORT
-
-
- 1.7 Special thanks must go out to...
-
- I would hereby like to thank some of the people who, through
- time, have helped me in creating the product you are in sight
- of; Daan van Rooien for giving me just that little bit of
- inspiration when I needed it most. Thijs Kuperus for helping
- me create some of the sound routines. My mom and dad, who kept
- telling me this would never work; "Hey, I will show them, I
- figured...". Rombout de Backer for his support when I thought
- the time had come to put this program to the test. Joris van
- Rongen and Elard Vermeulen for creating some great graphics.
- Sean Palmer, Kai Rohrbacher, Soeren Holstebroe and Stefan
- Ohrhallinger for showing me some of the principals on how
- graphics-programming is done. And thanks to you, Menno, for
- sparing me a couple of litres of coffee.
- Chapter 2: Getting started, a quick overview
-
-
- 2.1 The basic idea...
-
- I can still remember one of those times when I had some plans
- on creating a game and I ended up with some source in BASIC.
- The wonderful part about it was that in those days, at times,
- I was actually impressed by what speed one could achieve with
- a little bit of thought on how the program had to be set up.
- One could even implement simple vector-graphics in BASIC. Not
- that they were anywhere near filled but hey, it was a start.
- A problem arose however, as soon as this game also had to have
- at least SOME figures moving about the screen in the form of
- what are called sprites... The only way to do this was by
- erasing an old figure and then quickly redrawing the new
- version on top of it. This would cause a lot of flicker on
- screen as the erasing and drawing of figures required massive
- amounts of processor-time. As a result, your animations would
- end up looking ghostly and vague.
-
-
- 2.2 and my implementation
-
- So here's how we do it these days; We use the two-page con-
- cept, or rather the four-page concept as we actually have four
- pages to work with. The idea is to draw all your sprites on
- page A, while the monitor is displaying page B. Then we will
- quickly make page A the visible page and start drawing on page
- B. As the procedure that flips the pages executes very quic-
- kly, there will be no noticable flicker. But hey, you just
- mentioned we have four pages to work with, you will say; and
- indeed we do, so here's where we can get fancy. Imagine having
- a background picture on page C, which we will copy to the non-
- visible page before drawing anything else on this page. You
- guessed right; we can have our sprites drawn in front of the
- background picture. We could even have another picture on page
- D, so we can switch between these pictures as well... The
- whole G∙A∙M∙E package is actually based on this concept.
- Simply put, that is, of course... 8-)
- 2.3 An example program
-
- To get a general idea of what can be done with G∙A∙M∙E and how
- it all works, please have a glance at the accompanying demon-
- stration program GAMEDEMO.PAS. In future versions of this
- manual, I will discuss in detail how the program works. As for
- now, you have got to live and learn. It's not that hard.
- Chapter 3: The G∙A∙M∙E units, what do they do?
-
- As the G∙A∙M∙E program grew bigger and bigger, the need arose
- to split up all of the different routines in several groups.
- Currently, the program consists of nine different units, every
- one of them covering a certain range of routines. Thus, there
- is a unit to handle animations, a unit to handle music and
- sound effects, a unit to handle keyboard, mouse and joystick
- support, etc.
- You will now be presented with a general overview of all the
- G∙A∙M∙E units. I will try to describe in short what each unit
- does and in what way it can be of use to the programmer. All
- the constants, type definitions, procedures and functions for
- each of these units will also be listed here.
- For a more detailed description of what the procedures and
- functions found in each of these units do and how they work,
- please consult chapter 5, the G∙A∙M∙E reference manual.
- 3.1 TGK_MAIN; The general stuff
-
- The TGK_MAIN unit implements all of G∙A∙M∙E's basic routines,
- such as the ones needed to initialize and de-initialize the
- graphic mode. It also contains some basic procedures and data-
- types which need to be accessible to a lot of the other units,
- as well as some palette-handling and fading procedures. The
- TGK_MAIN unit provides you with all the necessary procedures
- to accomplish page-flipping, which is needed for smooth and
- fast animation. Here is the interface section of this unit:
-
-
- Type FillPatType = Array[0..15,0..15] of Byte;
- RGBEntry = Record
- R,G,B : Byte;
- End;
- PaletteType = Array[0..255] of RGBEntry;
- RasterType = Array[0..31] of Byte;
-
- Const ActPage : Word = 0; { Internal VideoPage - Always visible }
- CurPage : Word = 0; { User-Definable VideoPage }
- IsBusy : Boolean = False; { Busy-Flag, Internal use by Mouse }
-
- PageOffset : Array[0..4] Of Word = ($0000,$3E80,$7D00,$BB80,$FA00);
- PageSegment : Array[0..4] Of Word = ($A000,$A3E8,$A7D0,$ABB8,$AFA0);
-
- MinX : Word = 0; { Viewport coordinates: }
- MinY : Word = 0; { Default setting is view the whole screen }
- MaxX : Word = 319;
- MaxY : Word = 199;
-
- Var Raster : Array[1..20] of RasterType; { User definable rasters }
-
-
- Procedure OpenGraphics;
- Procedure CloseGraphics;
- Procedure Sync;
-
- Procedure SetPage(Pa:Word);
- Procedure ShowPage(Pa:Word);
- Procedure CopyPage(SourcePa,DestPa:Word);
- Procedure ClearPage(Pa:Word);
- Procedure FillPage(Pa:Word;Color:Byte);
- Procedure MoveBlock(X1,Y1,X2,Y2:Integer; SourcePa,DestPa:Word);
-
- Procedure SetViewPort(X1,Y1,X2,Y2:Integer);
- Procedure FullPort;
-
- Procedure Error(Message:String);
- Function UpString(Str:String):String;
-
- Procedure SwapInt(Var A,B:Integer);
- Procedure SwapWord(Var A,B:Word);
- Procedure SwapByte(Var A,B:Byte);
-
- Function LongMul(X,Y:Integer):LongInt;
- Function LongDiv(X:LongInt; Y:Integer):Integer;
- Function LongMod(X:LongInt; Y:Integer):Integer;
-
- Procedure SetColor(Nr:Byte; Entry:RGBEntry);
- Procedure GetColor(Nr:Byte; Var Entry:RGBEntry);
- Procedure SetPalette(Var Palette);
- Procedure GetPalette(Var Palette);
-
- Procedure SetWhitePal;
- Procedure SetBlackPal;
- Procedure SetColorPal(Color:Byte);
- (TGK_MAIN interface section; continued)
-
-
- Procedure FadeToWhite(Speed:Byte);
- Procedure FadeToBlack(Speed:Byte);
- Procedure FadeToColor(Color,Speed:Byte);
- Procedure FadeFromWhite(Speed:Byte);
- Procedure FadeFromBlack(Speed:Byte);
- Procedure FadeFromColor(Color,Speed:Byte);
-
- Procedure Standard_Palette; { Do not call! }
- 3.2 TGK_GP; Some graphics-primitives
-
- Quite comprehensive, this one. In addition to all the basic
- graphics-primitives you can expect in a unit like this, such
- as putpixel, line, rectangle, circle, ellipse etc., you'll
- also find some more "exotic" features here. This unit also
- supports various fill-styles and rasters, special line-drawing
- modes such as brighter, dimmer and zero and fast polygon- and
- triangle-drawing procedures. Alas, the interface part:
-
-
- Type Direction = (Up,Down,Left,Right);
- TriangleType = Record
- X,Y : Array[1..3] of Integer;
- Col : Byte;
- End;
-
- Const LineClipping : Boolean = False;
-
-
- Procedure PutPixel(X,Y:Integer; Color:Byte; Pa:Word);
- Function GetPixel(X,Y:Integer; Pa:Word):Byte;
- Procedure XorPixel(X,Y:Integer; Pa:Word);
- Procedure ZeroPixel(X,Y:Integer; Color:Byte; Pa:Word);
- Procedure BrighterPixel(X,Y:Integer; Color,Pa:Word);
- Procedure DimmerPixel(X,Y:Integer; Color,Pa:Word);
-
- Procedure Line(X1,Y1,X2,Y2:Integer; Color:Byte; Pa:Word);
- Procedure HLine(X1,Y1,X2:Integer; Color:Byte; Pa:Word);
- Procedure VLine(X1,Y1,Y2:Integer; Color:Byte; Pa:Word);
- Procedure XorLine(X1,Y1,X2,Y2:Integer; Pa:Word);
- Procedure ClipLine(X1,Y1,X2,Y2:Integer; Color:Byte; Pa:Word);
- Procedure BrighterLine(X1,Y1,X2,Y2:Integer; Color:Byte; Pa:Word);
- Procedure DimmerLine(X1,Y1,X2,Y2:Integer; Color:Byte; Pa:Word);
- Procedure ZeroLine(X1,Y1,X2,Y2:Integer; Color:Byte; Pa:Word);
-
- Procedure Rectangle(X1,Y1,X2,Y2:Integer; Color:Byte; Pa:Word);
- Procedure FRectangle(X1,Y1,X2,Y2:Integer; Color:Byte; Pa:Word);
- Procedure XorRectangle(X1,Y1,X2,Y2:Integer; Pa:Word);
- Procedure Square(X1,Y1,Size:Integer; Color:Byte; Pa:Word);
- Procedure FSquare(X1,Y1,Size:Integer; Color:Byte; Pa:Word);
- Procedure XorSquare(X1,Y1,Size:Integer; Pa:Word);
-
- Procedure Circle(X,Y,Radius:Integer; Color,Pa:Byte);
- Procedure FCircle(X,Y,Radius:Integer; Color,Pa:Byte);
- Procedure Ellipse(X,Y,XRadius,YRadius:Integer; Color,Pa:Byte);
- Procedure FEllipse(X,Y,XRadius,YRadius:Integer; Color,Pa:Byte);
-
- Procedure Triangle(Triangle:TriangleType; Pa:Word);
- Procedure FTriangle(Triangle:TriangleType; Pa:Word);
- Procedure Poly(NrPoints:Integer; Var Points; Color:Byte; Pa:Word);
- Procedure FPoly(NrPoints:Integer; Var Points; Color:Byte; Pa:Word);
-
- Procedure SetFillStyle(Style:Byte);
- Procedure SetUserFill(Nr:Byte; Var FillData);
- Procedure SetUserMask(Nr,OddMask,EvenMask:Byte);
- Procedure SetUserRaster(Nr:Byte; Var RasterData);
-
- Function Clip(Var X1,Y1,X2,Y2:Integer):Boolean;
- Procedure Paint(X,Y:Integer; Color:Byte; Pa:Word);
- Procedure PaintTo(X,Y:Integer; Color,BackColor:Byte; Pa:Word);
- Procedure SpLine(NrPoints:Word; Var CurveData; Color:Byte; Pa:Word);
-
- Procedure SaveFillStyle(Var Style:Byte);
- Procedure RestoreFillStyle(Style:Byte);
-
- Procedure ScrollPage(Page:Byte; Dir:Direction; Pixels,Color:Byte);
- 3.3 TGK_IO; User-interaction made easy
-
- Here, we will find functions to give you complete control over
- the keyboard, mouse and joystick. Large 20x20 pixels multico-
- lor mouse-cursors are supported, for fun, mostly. There's
- really a wide range of features to be found here, just check
- it out. Keyboard-emulation for a mouse (for those users who
- are rodent-less) is implemented as well. It works as follows:
- use [Alt] plus one of the arrows on the keypad (including
- Home, End, PgUp and PgDn for diagonal movement) to move the
- mouse cursor around. Holding down [Shift] as well, makes the
- cursor move faster (10 pixels each step, instead of 1). For
- the mouse-buttons use [Alt] plus the minus [-] and plus [+] on
- the keypad, where minus is the left and plus the right button.
- There interface part of the unit looks somewhat like this:
-
-
- Type JoyButtonType = (JoyLeftBut,JoyRightBut);
- JoyPosType = (XPosition,YPosition);
- JoyDirection = (LeftDir,RightDir,UpDir,DownDir,NoDir,
- UpLeftDir,UpRightDir,DownLeftDir,DownRightDir);
-
- MouseStruct = Array[0..19,0..19] of Byte;
- MouseSettingsType = Record
- X,Y : Integer;
- MouseP : Boolean;
- MinX,MinY,
- MaxX,MaxY : Word;
- SMinX,SMinY,
- SMaxX,SMaxY : Word;
- End;
-
- Const MouseX : Integer = 160;
- MouseY : Integer = 100;
- MousePointer : Boolean = False;
- DefaultCursor : MouseStruct = (...); { Not important }
-
- Var MouseDriver : Boolean;
- NrOfButtons : Byte;
- KeyTable : Array[1..127] of Boolean;
-
-
- Function Keypressed : Boolean;
- Function ReadKey : Char;
- Function FunctionKey : Boolean;
-
- Function CtrlPressed : Boolean;
- Function AltPressed : Boolean;
- Function ShiftPressed : Boolean;
- Function LShiftPressed : Boolean;
- Function RShiftPressed : Boolean;
-
- Procedure DisableKeyboard;
- Procedure EnableKeyboard;
- Procedure ClearKeyBuffer;
-
- Procedure InitMouse;
- Procedure MouseCursorOn;
- Procedure MouseCursorOff;
- Function LeftButton : Boolean;
- Function MiddleButton : Boolean;
- Function RightButton : Boolean;
- Function MouseMoved : Boolean;
- Function MouseIn(X1,Y1,X2,Y2:Integer) : Boolean;
- Procedure SetMouse(X,Y:Integer);
- Procedure SetMouseRange(X1,Y1,X2,Y2:Word);
- Procedure FullMouseRange;
- Procedure SetSpecialRange(X1,Y1,X2,Y2:Integer);
- Procedure NoSpecialRange;
- (TGK_IO interface section; continued)
-
-
- Procedure SetMouseSensivity(HR,VR:Integer);
- Procedure GetMouseMotion(Var Horizontal,Vertical:Integer);
- Procedure GetMouseSettings(Var MouseInfo:MouseSettingsType);
- Procedure SetMouseSettings(MouseInfo:MouseSettingsType);
- Procedure SetMouseCursor(Shape:MouseStruct);
-
- Function UserActivity : Boolean;
-
- Function GamePort : Boolean;
- Function GetJoyButton(JoyNr:Byte; Button:JoyButtonType) : Boolean;
- Function GetJoyPosition(JoyNr:Byte; Axis:JoyPosType) : Integer;
- Function GetJoyDirection(JoyNr:Byte) : JoyDirection;
- Function JoystickExists(JoyNr:Byte) : Boolean;
- Procedure CalibrateJoystick(JoyNr:Byte);
- 3.4 TGK_BM; Bitmapping and the like
-
- TGK_BM implements various bitmapping procedures. You can
- rotate bitmaps and scale them to any size, put them on screen
- in many different ways, such as brighter, dimmer, add or
- single-color. A mask page is supported as well, allowing
- sprites to be displayed on any one of 256 different layers. In
- my humble opinion, these procedures are pretty fast, allowing
- for really smooth programs. Here's the interface part:
-
-
- Type SpriteType = Record
- Sprite : Pointer; { Actual data }
- Size : Word; { Size of sprite in memory }
- ZPos : Byte; { Used with Mask-Screens }
- End;
- WaveType = Array[0..31] of Integer;
-
- Procedure GetImage(X1,Y1,X2,Y2:Integer; Var Sprite:SpriteType; Pa:Word);
-
- Procedure PutImage(X1,Y1:Integer; Sprite:SpriteType; Pa:Word);
- Procedure PutBlock(X1,Y1:Integer; Sprite:SpriteType; Pa:Word);
- Procedure PutScaled(X1,Y1:Integer; Centered:Boolean;
- Size:Word; Sprite:SpriteType; Pa:Word);
- Procedure PutRotated(X,Y,MoveX,MoveY:Integer;
- Angle:Word; Sprite:SpriteType; Pa:Word);
- Procedure PutImageBrighter(X1,Y1:Integer; Sprite:SpriteType; Pa:Word);
- Procedure PutImageDimmer(X1,Y1:Integer; Sprite:SpriteType; Pa:Word);
- Procedure PutImageAdd(X1,Y1:Integer; Sprite:SpriteType; Pa:Word);
-
- Procedure PutImageSC(X1,Y1:Integer; Color:Byte;
- Sprite:SpriteType; Pa:Word);
- Procedure PutScaledSC(X1,Y1:Integer; Centered:Boolean; Color:Byte;
- Size:Word; Sprite:SpriteType; Pa:Word);
-
- Procedure PutImageM(X1,Y1:Integer; Sprite:SpriteType; Pa:Word);
- Procedure PutScaledM(X1,Y1:Integer; Centered:Boolean;
- Size:Word; Sprite:SpriteType; Pa:Word);
-
- Procedure InitSprite(Var Sprite:SpriteType);
- Procedure DisposeSprite(Var Sprite:SpriteType);
-
- Function SpriteWidth(Sprite:SpriteType; Size:Word):Word;
- Function SpriteHeight(Sprite:SpriteType; Size:Word):Word;
- Function PixelInSprite(X,Y:Word; Sprite:SpriteType):Boolean;
-
- Procedure SetWave(Wave:WaveType);
- Procedure PutWave(X1,Y1:Integer; Sprite:SpriteType; Pa:Word);
- Procedure PutWaveSC(X1,Y1:Integer; Color:Byte;
- Sprite:SpriteType; Pa:Word);
- 3.5 TGK_SND; For your listening pleasure
-
- Using the TGK_SND unit you can add music and sound-effects to
- your programs. You can convert musical pieces from a wide
- range of existing files, namely the Adlib ROL-files, and have
- them play in the background while your program happily goes on
- doing other things. Samples can also be played, allowing for
- sound and speech effects. For music-playing, this unit sup-
- ports either an Adlib/Soundblaster card or the PC-Speaker
- (which sounds like crap) and for sample-playing it supports
- the Adlib, Soundblaster, PC-Speaker and Covox/DAC-Devices.
- Coming up, for your convenience, the interface part:
-
-
- Type SoundDevice = (Speaker,Adlib,SoundBlaster,Covox);
- ModeType = (Melodic,Percussive);
- SampleType = Record
- SignedSample,
- SampleStopped : Boolean;
- RepeatSample : Integer;
- Sample : Pointer;
- SampleLength,
- CurOffset : Word;
- Loaded : Boolean;
- End;
- MusHdr = Record
- ID : String[19];
- BasicTempo,TPB,Mode : Byte;
- NrIns,NrTEvents : Word;
- NrNotes,NrIEvents,
- NrVEvents,
- NrPEvents,LastTick : Array[1..11] of Word;
- End;
- MusicType = Record
- Header : MusHdr;
- InsData,TEvents : Pointer;
- NEvents,IEvents,
- VEvents,PEvents : Array[1..11] of Pointer;
- CurTEvent : Word;
- CurNote,CurDelay,
- CurIEvent,
- CurVEvent,
- CurPEvent : Array[1..11] of Word;
- MusicTicks : Word;
- NrVoices : Byte;
- Tempo : Word;
- Loaded : Boolean;
- TotalTicks : LongInt;
- LastTick : Word;
- LongestVoice : Byte;
- InterruptCounter : Word;
- RepeatMusic : Integer;
- End;
-
- Const AdlibInstalled : Boolean = False; { Is there an Adlib? }
- SBInstalled : Boolean = False; { Is there a SoundBlaster? }
- MusicDevice : SoundDevice = Speaker; { Current MusicDevice }
- DACDevice : SoundDevice = Speaker; { Current DACDevice }
- MusicPlaying : Boolean = False; { Music currently playing? }
- GlobalVol : Real = 1.0; { Overall FM-Music volume }
-
- Var MusInfo : Record
- Note : Array[1..11] of Byte;
- Volume : Array[1..11] of Byte;
- PitchBend : Array[1..11] of Word;
- PercentDone : Byte;
- End;
-
- (TGK_SND interface section; continued)
-
-
- { Routines for playing notes, setting the volume and instruments: }
- Procedure NoteOn(Note:Word; Voice:Byte); { Play note on 'MusicDevice' }
- Procedure NoteOff(Voice:Byte); { Stop note on 'MusicDevice' }
- Procedure SetMode(Mode:ModeType); { Set Melodic/Percussive mode }
- Procedure SetOverallVolume(Vol:Real); { Set Total Output-Level }
- Procedure SetVolume(Voice:Byte; Vol:Real); { Set Rel. Volume for a Voice }
- Procedure SetInstrument(Voice:Byte; Var Ins);{ Set Instrument for a Voice }
-
- { FM-Music Playback Routines: }
- Procedure InitMusic(Var MusicData:MusicType);
- Procedure LoadMusic(Var MusicData:MusicType; FileName:String);
- Procedure SaveMusic(Var MusicData:MusicType; FileName:String);
- Procedure DisposeMusic(Var MusicData:MusicType);
- Procedure SetMusicDevice(Device:SoundDevice);
- Procedure StartMusic(Var MusicData:MusicType; Times:Byte);
- Procedure PauseMusic;
- Procedure StopMusic;
-
- { Digital Sound Playback Routines: }
- Procedure InitSample(Var Sample:SampleType);
- Procedure LoadSample(Var Sample:SampleType;
- FileName:String; Signed:Boolean);
- Procedure DisposeSample(Var Sample:SampleType);
- Procedure StartSample(Var Sample:SampleType; Times:Byte);
- Procedure StopSample;
- Procedure SetSampleSpeed(Speed:Word);
- Procedure SetDACDevice(Device:SoundDevice);
- Procedure SetDigiVolume(Volume:Byte);
- Procedure SetDACPort(PortNr:Word); { For the Covox, that is! }
-
- { HiRes Timing Routines: }
- Procedure StartTimer(TimerNr:Byte);
- Function TimerTicks(TimerNr:Byte):Word;
- Procedure WaitTimer(TimerNr:Byte; Ticks:Word; Reset:Boolean);
- 3.6 TGK_WIN; A graphical user interface (GUI)
-
- If you want to create an easily understandable, good-looking
- menu structure, TGK_WIN is the unit for you. It provides you
- with moveable "MicroSoft Windows (TM)"-style windows. All
- sorts of buttons can be added to these windows and handling
- them is really easy. There are some predefined windows, such
- as a file-selection-window, which is always a tough one to
- implement. The colors and fillstyles can be changed to allow
- for your personal window-"look". Try it for fast results:
-
-
- Uses TGK_BM;
-
- Const MaxButtons = 30;
- Yes = True;
- No = False;
-
- WDefault = 0;
- WCloseAble = 1;
- WMoveAble = 2;
-
- Type WinBut = (PushButton,CheckButton,StringButton,
- PullButton,HSlideButton,VSlideButton,NoButton);
-
- ButtonType = Record
- Style : WinBut;
- X,Y,
- XSize,YSize : Word;
- Message : String;
- State : Boolean;
- MinValue,
- MaxValue,
- CurValue : Integer;
- End;
-
- WindowColorSet = Record
- Line,BackGround,Button,
- Text,FillStyle,Bright,
- Dim,Bar,Finch,BarFill : Byte;
- End;
-
- WindowType = Record
- Open : Boolean;
- StatusByte : Byte;
- X,Y,
- XSize,YSize : Integer;
- Pa : Word;
- SavedData : SpriteType;
- WinSize : Word;
- Title : String;
- Buttons : Array[1..MaxButtons] of ButtonType;
- End;
-
- Procedure InitWindow(Var Window:WindowType;
- X,Y,XSize,YSize:Integer; Title:String);
- Procedure OpenWindow(Var Window:WindowType; Status:Byte; Pa:Word);
- Procedure RefreshWindow(Var Window:WindowType);
- Procedure CloseWindow(Var Window:WindowType);
- Function HandleWindow(Var Window:WindowType):Word;
-
- Function StringWindow(X,Y,XSize,Pa:Word; Title,StartStr:String):String;
- Function QuestionWindow(X,Y,Pa:Word; Question:String):Boolean;
- Function FileWindow(X,Y,Pa:Word; Title,FileSpec:String):String;
- Procedure MessageWindow(X,Y,Pa:Word; Message:String);
-
- (TGK_WIN interface section; continued)
-
-
- Procedure AddPushButton(Var Window:WindowType; Nr,X,Y:Word;
- Message:String);
- Procedure AddCheckButton(Var Window:WindowType; Nr,X,Y:Word;
- Message:String; State:Boolean);
- Procedure AddHSlideButton(Var Window:WindowType;
- Nr,X,Y,XSize:Word;
- MinVal,MaxVal,CurVal:Integer);
- Procedure AddVSlideButton(Var Window:WindowType;
- Nr,X,Y,YSize:Word;
- MinVal,MaxVal,CurVal:Integer);
- Procedure AddStringButton(Var Window:WindowType;
- Nr,X,Y,XSize:Word; StartStr:String);
-
- Function CheckButtonResult(Window:WindowType; Nr:Word):Boolean;
- Function SlideButtonResult(Window:WindowType; Nr:Word):Word;
- Function StringButtonResult(Window:WindowType; Nr:Word):String;
-
- Procedure SetWindowColors(ColorSet:WindowColorSet);
- Procedure GetWindowColors(Var ColorSet:WindowColorSet);
- Procedure SetDefaultWindowColors;
- 3.7 TGK_3D; Vector graphics take off
-
- If you are into making games like Elite, or making smooth
- looking demonstration programs, you will most definetely like
- this unit a good lot. It provides you with all the functions
- needed to do moving, rotating and resizing vector objects.
- The only part that is still up to you is creating the objects,
- which takes some imagination if you want them to look really
- original, I've come to realize lately...
-
-
- Type ClipType = (ClipNone,ClipLeft,ClipRight,ClipTop,ClipBottom);
-
- Procedure InitObject(Nr:Word);
- Procedure DisposeObject(Nr:Word);
- Procedure DisposeAllObjects;
- Procedure SetOrigin(Nr:Word; X,Y:Integer);
- Procedure MoveOrigin(Nr:Word; X,Y:Integer);
- Procedure MoveObject(Nr:Word; X,Y,Z:Integer);
- Procedure SizeObject(Nr:Word;R:Real);
-
- Procedure AddPoint(Nr:Word; X,Y,Z:Real);
- Procedure AddSurface3(Nr:Word; V1,V2,V3:Integer; Color,Style:Byte);
- Procedure AddSurface4(Nr:Word; V1,V2,V3,V4:Integer; Color,Style:Byte);
- Procedure AddSurface5(Nr:Word; V1,V2,V3,V4,V5:Integer; Color,Style:Byte);
-
- Procedure RotateObject(Nr:Word; RX,RY,RZ:Integer);
- Procedure HideObject(Nr:Word);
- Procedure DrawObjectWireframe(Nr,Pa:Word);
- Procedure DrawObjectFilled(Nr,Pa:Word);
-
- Procedure WireColor(Color:Byte);
- Function ClipObject(Nr:Word; XMin,XMax,YMin,YMax:Integer) : ClipType;
- 3.8 TGK_TEXT; Get the message out!
-
- The TGK_TEXT unit provides you with all the neccesary functi-
- ons to put text on screen. Text can be displayed in any size,
- along a vertical wave, etc. What more is there to be said,
- just try this unit and I am pretty sure you will like it:
-
-
- Const LeftText = 0;
- CenterText = 1;
- RightText = 2;
- BottomText = 0;
- TopText = 2;
-
- Type TextModeType = (Speed,Precision);
- TextSettingsType = Record
- ActiveFont,Spacing : Byte;
- TextSize : Word;
- Prop : Boolean;
- Hjustify,VJustify : Byte;
- TextMode : TextModeType;
- End;
-
-
- Procedure Outtext(X,Y:integer; Color:Byte; Pa:Word; S:String);
- Procedure OuttextHLine(X,Y,YPos:Integer; Color:Byte; Pa:Word; S:String);
- Procedure OuttextVLine(X,Y,XPos:Integer; Color:Byte; Pa:Word; S:String);
- Procedure OuttextWave(X,Y:Integer; Color:Byte; Pa:Word; S:String);
- Function StringWidth(S:String) : Word;
-
- Procedure LoadFont(Name:String; Nr:Byte);
- Procedure SetFont(Nr:Byte);
- Procedure DisposeFont(Nr:Byte);
- Procedure DisposeAllFonts;
-
- Procedure SetTextSize(Size:Word);
- Procedure SetTextJustify(Horizontal,Vertical:Byte);
- Procedure SetSpacing(Space:Byte);
- Procedure SetProportional(Proportional:Boolean);
- Procedure SetTextMode(Mode:TextModeType);
-
- Procedure GetTextSettings(Var Settings:TextSettingsType);
- Procedure SetTextSettings(Settings:TextSettingsType);
- Procedure DefaultTextSettings;
- 3.9 TGK_ANIM; Look mom, it's moving...
-
- The TGK_ANIM unit allows you to add animations to your pro-
- grams. These can be created using the ANIMEDIT program. Lots
- of options can be specified for each animation, allowing for
- very complex animation movement and behaviour without any need
- for the program to update animation parameters whatsoever.
- Just one routine, HandleAnimation, does the job. Of course, if
- you plan on doing special stuff with animations, you can
- always control them more directly.
- This unit allows for what I call "Animation-Cloning", saving a
- lot of memory. When you clone an animation you put all of it's
- parameters in another animation, but not the actual picture
- data. The cloned animation still uses the picture data from
- the original animation, requiring only a few bytes of memory.
-
-
- Type AnimMode = (AnimStatic,AnimMove,AnimRandom,AnimPath,AnimInactive);
-
- AnimSpec = (AnimXStep,AnimYStep,AnimSpeed,AnimZPos,
- AnimDir,AnimPong,AnimChance);
-
- FrameRec = Array[1..50] of Record
- Bitmap : Pointer; { Actual data }
- BMSize : Word; { size of data }
- X,Y : Integer; { (X,Y)-offset }
- XSize,YSize : Word; { and (X,Y)-size }
- End;
-
- PathType = Record
- Path : Pointer; { Actual Data }
- NrPoints : Word; { Number of Entries }
- CurPoint : Word; { and current entry }
- End;
-
- AnimType = Record
- Loaded : Boolean; { Animation Loaded ? }
- Cloned : Boolean; { Animation has been cloned? }
- Frame : ^FrameRec;{ Pointer to frame-data }
- Range : Record
- StartX, { Movement area for this }
- StartY, { animation... }
- EndX,
- EndY : Integer;
- End;
- CurFrame : Byte; { Current Frame }
- NrFrames : Byte; { Nr. of Frames in animation }
- Speed, { Animation Speed }
- SpeedIdx : Word; { and Speed-Index }
- Mode : AnimMode; { Current animation mode }
- Path : PathType; { The animation path, if any }
- X,Y : Integer; { (X,Y)-Pos on Screen }
- XStep,
- YStep : ShortInt; { X- and Y-Axis Movement-speed }
- ZPos : Byte; { ZPos for Mask-Page }
- PingPong : Boolean; { Does this one bounce? }
- CountUp : Boolean; { Going up or down... }
- MaxX,MaxY : Word; { Largest frame-size }
- Chance : Word; { Chance of handling... }
- InChance : Boolean; { Currently in a "Chance"? }
- End;
-
- Const UseMask : Boolean = False; { Use the Mask-Page for anims? }
- (TGK_ANIM interface section; continued)
-
-
- Procedure InitAnimation(Var Animation:AnimType);
- Procedure DisposeAnimation(Var Animation:AnimType);
-
- Procedure LoadAnimation(Var Animation:AnimType; FileName:String);
- Procedure CloneAnimation(Var SourceAnim,DestAnim:AnimType);
-
- Procedure SetupAnimation(Var Animation:AnimType;
- X,Y:Integer; Mode:AnimMode);
- Procedure AnimationSpecs(Var Animation:AnimType;
- Spec:AnimSpec; Value:Integer);
- Procedure HandleAnimation(Var Animation:AnimType; Pa:Word);
-
- Procedure LoadPath(Var Animation:AnimType; FileName:String);
- 3.10 TGK_FILE; File Handling routines
-
- Various file handling routines. Loads many different picture
- formats, stores files in resources etc. Interface:
-
-
- Uses Tgk_BM;
-
- Const Resource : String = ''; { Default is no resource, change at will }
-
- Type PalUpdates = (None,Replace,Remap);
-
-
- Procedure NewResource;
- Procedure AddToResource(FileName:String);
-
- Function PackData(Var DataIn,DataOut; NrIn:Word; Var NrOut:Word):Boolean;
- Function UnpackData(Var DataIn,DataOut; NrIn:Word; Var NrOut:Word):Boolean;
-
- Procedure LoadGPF(FileName:String; Pa:Word);
- Procedure SaveGPF(FileName:String; Pa:Word);
-
- Procedure LoadGIF(FileName:String; Pa:Word);
- Procedure LoadBMP(FileName:String; Pa:Word);
- Procedure LoadLBM(FileName:String; Pa:Word);
- Procedure LoadPCX(FileName:String; Pa:Word);
-
- Procedure LoadImage(FileName:String; Var Sprite:SpriteType);
- Procedure SaveImage(FileName:String; Sprite:SpriteType);
- Procedure LoadBBM(FileName:String; Var Sprite:SpriteType);
-
- Function InitFile(Var FileHandle:File; FileName:String;
- Var FSize:LongInt):Boolean;
- Function Exist(FileName:String):Boolean;
- Function GoodName(FileName:String):String;
-
- Function Extension(FileName:String):String;
- Procedure DefaultExtension(Var FileName:String; Extension:String);
- Procedure NewExtension(Var FileName:String; Extension:String);
-
- Procedure SetPalUpdate(Update:PalUpDates);
- Procedure SetLoadOffset(X,Y:Word);
- Chapter 4: Utility programs
-
-
- 4.1 GAMECAP; A screen-capture program
-
- GAMECAP is a small utility allowing you to "steal" pictures
- from other programs. Once installed, it will wait until you
- press the hot-key and [Plop!], it sort of "pops up", saving
- the picture on screen in a GPF-file, a Game Picture-File,
- allowing you to use it in your own programs. GAMECAP will
- automatically compress your picture, saving quite a large
- amount of diskspace in most cases. GAMECAP will capture
- screens from any 320x200x256 mode, be it the standard BIOS-
- Mode (13h) or the tweaked X-Mode.
-
-
- 4.2 ANIMEDIT; A full-featured animation editor
-
- Using ANIMEDIT you can create your own animations from series
- of frames you've drawn. ANIMEDIT takes the name of a picture-
- file you want to use to capture the frames from as an optional
- parameter. This file can be in any format G∙A∙M∙E recognizes
- and if it is not specified, ANIMEDIT assumes you only want to
- have a look at an existing animation. The program is pretty
- self-explanatory and is fully controlled using a mouse, which
- should make it really easy to use. However, there are a few
- things worth mentioning here, I guess. First of all, a new
- animation frame is simply "grabbed" from the loaded picture by
- holding down the left mouse-cursor and creating a box around
- the area of interest. After releasing the left button,
- ANIMEDIT will automatically present you with it's animation-
- menu. Now you can align the frame you've just grabbed in the
- "animation-box" and click the left mouse button to put it
- down. It will then be displayed in the "animation-box", in the
- background. You can move over it again and put it down a few
- pixels to the left this time, or you could click on the close-
- window button (upper-left corner of the animation-menu) and
- grab a new frame from the background picture.
- You will notice that there are two slide-bars at the lower and
- right side of the "animation-box". The one on the lower side
- is used to select the current frame and the one on the right
- to set the animation-speed. In addition to this, please note
- the two check buttons on the lower right side of the window.
- These are used to set the animation-direction and whether the
- animation will restart with frame one after it has reached the
- final frame or it will start counting down from that time on.
- Just fiddle around with them, you'll see what I mean.
- Once you're finished, you can save your animation for later
- use. I know all this might sound quite complicated right now
- but it really isn't; I'm just not sure on how to explain this
- to you clearly. Anyway, I've implemented a clear-animation
- button as well, for those times when you really screw up
- things ;-)
- 4.3 ROL2GMF; A music-conversion program
-
- This program is used to convert music-files from the Adlib
- ROL-format to the much more versatile GMF-format, which is
- short for Game Music File. Instruments will no longer be in
- seperate files, as with the ROL-format and you'll see a
- significant decrease in filesize, usually about 40%. The
- program supports wildcars, allowing to convert large collecti-
- ons of music-files all in one go. Please note however, that
- due to a strange bug, the music-files need to be in the same
- direction as the conversion program when using wildcards to
- specify multiple files. When only converting one file, this
- error doesn't seem to occur 8'(
-
-
- 4.4 GAMEFONT; A font-conversion program
-
- With GAMEFONT you can convert fonts to the GFF-format, short
- for Game Font File. Currently supported formats are the CRD-
- format, as used by THG (The Humble Guys) in their program
- MEGAFONT, which comes with Intro Maker 3.0 and the FNT-format
- as used by PC-Magazine's FontEdit. The latter is also used by
- Kai Rohrbacher's ANIVGA-toolkit, which comes packed with a lot
- of these fonts.
- Upon startup, the program will first ask you to specify the
- fonttype to be converted. If you pick FontEdit, you will only
- have to supply GAMEFONT with the name (and optionally path) of
- the source-fontfile. No further options are in effect. If you
- choose THG-Fonts, however, you will first have to tell GAME-
- FONT what type of graphicsfile to use for the source-fontfile.
- You can choose from GIF, PCX and LBM. Now GAMEFONT will ask
- you for the name of this graphicsfile and it's accompanying
- coordinatefile (.CRD). Thus, if your font was in the file
- FONT.GIF, the coordinatefile would have to be named FONT.CRD.
- Finally, GAMEFONT will ask whether or not you want palette-
- remapping applied. If you answer yes, each color in the font-
- file will be replaced with the closest matching color from the
- standard G∙A∙M∙E-palette, which is in fact the standard DeLuxe
- Paint ][ Enhanced palette.
-
-
- 4.5 MAKERES; A resource-file creator
-
- MAKERES is a very simple program ("as is"), allowing you to
- store different datafiles in a single resourcefile. If you
- specify a resourcefile in one of your programs, the program
- will automatically search for any data it needs in this re-
- sourcefile. If not found, it will still try to use external
- data. When run, MAKERES first of all prompts your for the name
- of a resourcefile. If this file already exists, you can choose
- to either replace it or append data to it. Now MAKERES will
- continue asking for names of files to add to the resource
- until you enter a blank line.
- As for now, functions such as removing files from resources or
- replacing files in resources are NOT supported. This is sub-
- ject to change in future versions of G∙A∙M∙E however, as
- MAKERES is bound to be improved a lot in the future.
- Chapter 5: G∙A∙M∙E reference manual
-
-
- ActPage (Variable; do not modify) TGK_MAIN
- ──────────────────────────────────────────────────────────────
- ActPage : Word;
-
- This variable always contains the number of the visible page
- in videomemory. It may come in handy when you have a procedure
- that writes to video-memory, but you do not know in advance
- which page you will be writing to. A good example of this is
- the G∙A∙M∙E mouse-driver which always needs to draw the cursor
- on the visible page, but doesn't have any knowledge of what
- page the user will be using at a certain moment.
-
-
- AddCheckButton (Procedure) TGK_WIN
- ──────────────────────────────────────────────────────────────
- AddCheckButton(Var Window:WindowType; Nr,X,Y:Word;
- Message:String; State:Boolean);
-
- Adds checkbutton number [Nr] at position (X,Y) to the window
- [Window]. [Message] is the text that will be displayed next to
- the button and [State] reflects the initial state of the
- button. [Nr] must be in the range 1..MaxButtons and [Window]
- must be a window that has been previously initialized through
- a call to InitWindow.
-
-
- AddHSlideButton (Procedure) TGK_WIN
- ──────────────────────────────────────────────────────────────
- AddHSlideButton(Var Window:WindowType; Nr,X,Y,XSize:Word;
- MinVal,MaxVal,CurVal:Integer);
-
- Adds horizontal slidebutton number [Nr] at position (X,Y) to
- the window [Window]. [XSize] is the horizontal size in pixels
- of this button. [MinVal] and [MaxVal] are the lower and upper
- limits for the button and [CurVal] contains the initial value.
- [CurVal] must be in the range [MinVal]..[MaxVal], [Nr] must be
- in the range 1..MaxButtons and [Window] must be a window that
- has been previously initialized through a call to InitWindow.
-
-
- AddPoint (Procedure) TGK_3D
- ──────────────────────────────────────────────────────────────
- AddPoint(Nr:Word; X,Y,Z:Real);
-
- Adds a new point to vector-object [Nr] with the coordinates
- (X,Y,Z). Object [Nr] must have been previously initalized and
- no more than 200 points can be defined per object. Each point
- added will have a value one higher than the last point, star-
- ting with 1. Thus, the first point added will be 1, the second
- added will be 2, etc. Here's an example:
-
- InitObject(1);
- AddPoint(1,10,10,10); { 1 }
- AddPoint(1,-10,-10,10); { 2 }
- AddPoint(1,10,-10,10); { 3 }
- AddSurface3(1,1,2,3,7,0); { Triangle, solid-gray-fill }
-
-
- AddPushButton (Procedure) TGK_WIN
- ──────────────────────────────────────────────────────────────
- AddPushButton(Var Window:WindowType; Nr,X,Y:Word;
- Message:String);
-
- Adds pushbutton number [Nr] at position (X,Y) to the window
- [Window]. [Message] is the text that will be displayed on the
- button. [Nr] must be in the range 1..MaxButtons and [Window]
- must be a window that has been previously initialized through
- a call to InitWindow.
-
-
- AddStringButton (Procedure) TGK_WIN
- ──────────────────────────────────────────────────────────────
- AddStringButton(Var Window:WindowType; Nr,X,Y,XSize:Word;
- StartStr:String);
-
- Adds stringbutton number [Nr] at position (X,Y) to the window
- [Window]. The button will have a horizontal size in pixels of
- [XSize]. [StartStr] contains the initial string value for the
- button. [Nr] must be in the range 1..MaxButtons and [Window]
- must be a window that has been previously initialized through
- a call to InitWindow.
-
-
- AddVSlideButton (Procedure) TGK_WIN
- ──────────────────────────────────────────────────────────────
- AddVSlideButton(Var Window:WindowType; Nr,X,Y,YSize:Word;
- MinVal,MaxVal,CurVal:Integer);
-
- Adds vertical slidebutton number [Nr] at position (X,Y) to the
- window [Window]. [XSize] is the vertical size in pixels of
- this button. [MinVal] and [MaxVal] are the lower and upper
- limits for the button and [CurVal] contains the initial value.
- [CurVal] must be in the range [MinVal]..[MaxVal], [Nr] must be
- in the range 1..MaxButtons and [Window] must be a window that
- has been previously initialized through a call to InitWindow.
-
-
- AddSurface3 (Procedure) TGK_3D
- ──────────────────────────────────────────────────────────────
- AddSurface3(Nr:Word; V1,V2,V3:Integer; Color,Style:Byte);
-
- Adds a surface with 3 vertices (triangular) to vector-object
- [Nr]. [V1], [V2] and [V3] specify the 3 corners for this
- surface, corresponding to the points specified with AddPoint.
- [Color] is the color that will be used when drawing this
- surface and [Style] corresponds to one of the styles listed
- under setfillstyle.
-
-
- AddSurface4 (Procedure) TGK_3D
- ──────────────────────────────────────────────────────────────
- AddSurface4(Nr:Word; V1,V2,V3,V4:Integer; Color,Style:Byte);
-
- Adds a surface with 4 vertices (quadrangular) to vector-object
- [Nr]. [V1], [V2], [V3] and [V4] specify the 4 corners for this
- surface, corresponding to the points specified with AddPoint.
- [Color] is the color that will be used when drawing this
- surface and [Style] corresponds to one of the styles listed
- under setfillstyle.
-
-
- AddSurface5 (Procedure) TGK_3D
- ──────────────────────────────────────────────────────────────
- AddSurface5(Nr:Word; V1,V2,V3,V4,V5:Integer;
- Color,Style:Byte);
-
- Adds a surface with 5 vertices (pentagonal) to vector-object
- [Nr]. [V1], [V2], [V3], [V4] and [V5] specify the 5 corners
- for this surface, corresponding to the points specified with
- AddPoint. [Color] is the color that will be used when drawing
- this surface and [Style] corresponds to one of the styles
- listed under setfillstyle.
-
-
- AddToResource (Procedure) TGK_FILE
- ──────────────────────────────────────────────────────────────
- AddToResource(FileName:String);
-
- Add the file referred to by [FileName] to the (existing) re-
- source file as specified with the [Resource] variable. Does
- not check to see whether the file already exists in the re-
- source-file, but if this is so, it's of no use adding the file
- to the resource, because the previously added file with the
- same name will always be found first. In other words, existing
- files in a resource cannot be updated. There's really not much
- point in using this procedure, unless you would like to create
- your own resource-file maker, such as MAKERES.
-
-
- AdlibInstalled (Const) TGK_SND
- ──────────────────────────────────────────────────────────────
- AdlibInstalled : Boolean;
-
- [AdlibInstalled] will be set to true if an Adlib-Compatible
- soundcard was found in your system. Otherwise, it will be set
- to false.
-
-
- AltPressed (Function) TGK_IO
- ──────────────────────────────────────────────────────────────
- AltPressed : Boolean;
-
- Returns true if the Alt-Key is currently being pressed.
-
-
- AnimationSpecs (Procedure) TGK_ANIM
- ──────────────────────────────────────────────────────────────
- AnimationSpecs(Var Animation:AnimType;
- Spec:AnimSpec; Value:Integer);
-
- Sets the specification [Spec] for the animation [Animation] to
- the value [Value]. For a complete list of all available anima-
- tion specifications, look at AnimSpec.
-
-
- AnimMode (Type) TGK_ANIM
- ──────────────────────────────────────────────────────────────
- AnimMode = (AnimStatic, AnimMove, AnimRandom,
- AnimPath, AnimInactive);
-
- This type is used in conjunction with SetupAnimation to speci-
- fy in what manner an animation will behave. The different
- modes are as follows:
-
- · AnimStatic Animation does not move on either X- or Y-
- axis. An example of it's use could be that
- of a house with a burning fire inside,
- which we can see flickering through the
- window. All the frames will be displayed
- at the same (X,Y)-coordinates.
-
- · AnimMove Animation moves along the X- and/or Y-axis
- at a speed determined by the AnimXStep and
- AnimYStep variables which are defined
- using AnimationSpecs. Could be used with,
- for example, a sleigh sliding by.
-
- · AnimRandom Animation moves along the X- and Y-Axis at
- random at a maximum speed determined by
- the AnimXStep and AnimYStep variables
- which are defined using AnimationSpecs.
-
- · AnimPath Animation moves along a given path. This
- path needs to be loaded from a separate
- file, using LoadPath. Nice if you want
- your animation to move about in a very
- special way, which is not easy to describe
- using a simple formula.
-
- · AnimInactive Animation will not be displayed when a
- call to HandleAnimation is made. Used to
- temporarily turn of certain animations.
-
-
- AnimSpec (Type) TGK_ANIM
- ──────────────────────────────────────────────────────────────
- AnimSpec = (AnimXStep, AnimYStep, AnimSpeed, AnimZPos,
- AnimDir, AnimPong, AnimChance);
-
- This type is used in conjunction with AnimationSpecs to speci-
- fy what animation-specification to change. Here's what the
- various options stand for:
-
- · AnimXStep Sets the movement speed along the X-axis.
- Should be in the range [-127,127], with
- the unit being pixels.
-
- · AnimYStep Sets the movement speed along the Y-axis.
- Should be in the range [-127,127], with
- the unit being pixels.
-
- · AnimSpeed Sets the animation speed. The higher the
- value, the lower the speed, a new frame
- will become active each [AnimSpeed] calls.
-
- · AnimZPos Sets the Z-position for use with the mask
- screen. For more information on how the
- mask screen works, have a look at Sprite-
- Type and PutImageSC. To have HandleAnima-
- tion actually use the mask screem, make
- sure you set the UseMask variable to true.
-
- · AnimDir Sets the direction in which the frames
- will be played. False is from high to low
- (1 to NrFrames) and true from low to high
- (NrFrames downto 1).
-
- · AnimPong Specifies whether animations "wrap-around"
- or "bounce". When set to false, frame 1
- will be displayed after the last frame has
- been displayed (or the last frame will be
- displayed after frame 1 has been display-
- ed, depending on the current setting of
- [AnimDir]). When set to true, the animati-
- on will first count from frame 1 to the
- last frame, then back to frame 1 and than
- back to the last frame again, etc (or
- vice-versa, depending on the current set-
- ting of [AnimDir]).
-
- · AnimChance Sets the relative chance for an animation
- to actually be played. Suppose you set
- this to 20. This will give you a 1 out of
- 20 chance that the animation will be play-
- ed. If this "1 out of 20" occurs, the
- animation will be played for one full
- round, that is, all frames will be dis-
- played once (or twice if [AnimPong] is set
- to true). After that, another "1 out of
- 20" has to occur to start it again.
-
-
- AnimType (Type) TGK_ANIM
- ──────────────────────────────────────────────────────────────
- AnimType = Record
- [This is a very complicated record.
- Therefore, only the entries of interest
- to the user will be displayed here...]
- Frame : ^FrameRec
- Range : Record
- StartX,StartY,EndX,EndY : Integer;
- End;
- CurFrame : Byte;
- NrFrames : Byte;
- Path : PathType;
- Mode : AnimMode;
- X,Y : Integer;
- MaxX,MaxY : Word;
- End;
-
- The type [AnimType] is a general type used for all animations.
- [Frame] is a pointer to an array of frame-descriptions, as
- discussed under FrameRec. [Range] is a sub-record which may be
- used to set sort of a viewport for the animation. If you would
- set [Range.StartX] to 100 and your sprite would be moving from
- the right edge of the screen to the left, using the AnimMove
- mode, it would wrap around at 100-[MaxX] and thus be displayed
- at the right edge of the screen again. Just fiddle around with
- it. [CurFrame] denotes the current frame for this animation,
- whereas [NrFrames] contains the number of frames it consists
- of. [Path] is a pointer to a path-structure, as discussed
- under PathType. [Mode] reflects the animation-mode as discus-
- sed under AnimMode. [X] and [Y] are the current (X,Y)-coordi-
- nates on screen, for this animation. [MaxX] and [MaxY] are the
- respective X- and Y-size in pixels of the largest frame found
- in the animation. They are used in conjunction with [Range];
- as discussed above.
-
-
- BottomText (Const) TGK_TEXT
- ──────────────────────────────────────────────────────────────
- BottomText = 0;
-
- Used in conjunction with SetTextJustify, for more information
- on how this procedure works, have a look under the appropriate
- header.
-
-
- BrighterLine (Procedure) TGK_GP
- ──────────────────────────────────────────────────────────────
- BrighterLine(X1,Y1,X2,Y2:Integer; Color:Byte; Pa:Word);
-
- Draws a line from (X1,Y1) to (X2,Y2) on page [Pa], giving it a
- "brighter" appeal. This will only work correctly when using
- the default G∙A∙M∙E color-palette. [Color] specifies the color
- to be used when underlying pixels have a value of zero. Use
- DimmerLine as a contrastive procedure. Will either clip to the
- current viewport boundaries or not, depending on the setting
- of LineClipping.
-
-
- BrighterPixel (Procedure) TGK_GP
- ──────────────────────────────────────────────────────────────
- BrighterPixel(X,Y:Integer; Color:Byte; Pa:Word);
-
- Gives the pixel at position (X,Y) on page [Pa] a "brighter"
- appeal. This will only work correctly when using the default
- G∙A∙M∙E color-palette. [Color] specifies the color to be used
- when the underlying pixel has a value of zero. Use Dimmerpixel
- as a contrastive procedure. Will clip to the current viewport
- boundaries.
-
-
- ButtonType (Type) TGK_WIN
- ──────────────────────────────────────────────────────────────
- ButtonType = Record
- { Loads-o-junk... }
- XSize,YSize : Word;
- End;
-
- This type is used as a subtype for WindowType to describe one
- button in a window. The only fields of interest are XSize and
- YSize which will allow the user to create "custom-sized"
- buttons by changing their value AFTER the button has been
- created using one of the AddButton functions. Example:
-
- Var MyWin : WindowType;
-
- InitWindow(MyWin,10,10,200,100,'Hi I am "Pizza" Femke!');
- AddPushButton(MyWin,1,20,20,'Let''s do Quattro Stagione');
- MyWin.Buttons[1].XSize:=150; { Make long button... }
- OpenWindow(MyWin,WCloseAble,0);
- Repeat
- Until HandleWindow(MyWin)=0;
- CloseWindow(MyWin);
-
-
- CalibrateJoystick (Procedure) TGK_IO
- ──────────────────────────────────────────────────────────────
- CalibrateJoystick(JoyNr:Byte);
-
- Calibrates the joystick in port [JoyNr] for use with G∙A∙M∙E.
- First waits for the user to move the joystick to it's upper-
- left corner and press the left-button. Then waits for the user
- to move it to the lower-right corner and press the right
- button. Does not display ANY messages on screen, you will have
- to account for that yourself. This was done to allow for total
- "designing-freedom" on the programmers side.
-
-
- CenterText (Const) TGK_TEXT
- ──────────────────────────────────────────────────────────────
- CenterText = 1;
-
- Used in conjunction with SetTextJustify, for more information
- on how this procedure works, have a look under the appropriate
- header.
-
-
- CheckButtonResult (Function) TGK_WIN
- ──────────────────────────────────────────────────────────────
- CheckButtonResult(Window:WindowType; Nr:Word):Boolean;
-
- A call to this procedure reflects the current state of a
- button of type checkbutton, specified as button number [Nr]
- for window [Window]. Example:
-
- Var SoundWin : WindowType;
- Effects,Score : Boolean;
- WinResult : Word;
-
- InitWindow(SoundWin,10,10,150,100,'Sound selection:');
- AddCheckButton(SoundWin,1,20,20,'Sound Effects',True);
- AddCheckButton(SoundWin,2,20,40,'Musical Score',False);
- AddPushButton(SoundWin,3,20,60,'All done...');
- OpenWindow(SoundWin,WMoveable,0);
- Repeat
- WinResult:=HandleWindow(SoundWin);
- If WinResult=1 then
- Effects:=CheckButtonResult(SoundWin,1) else
- If WinResult=2 then
- Score:=CheckButtonResult(SoundWin,2);
- Until WinResult=3; { All Done... }
- CloseWindow(SoundWin);
-
-
- Circle (Procedure) TGK_GP
- ──────────────────────────────────────────────────────────────
- Circle(X,Y,Radius:Integer; Color,Pa:Byte);
-
- Draws a circle on page [Pa], using color [Color]. The circle
- will be centered at (X,Y) and have a radius of [Radius]
- pixels. Will clip to the current viewport.
-
-
- ClearKeyBuffer (Procedure) TGK_IO
- ──────────────────────────────────────────────────────────────
-
- Removes all waiting keypresses from the keyboardbuffer.
-
-
- ClearPage (Procedure) TGK_MAIN
- ──────────────────────────────────────────────────────────────
- ClearPage(Pa:Word);
-
- Will clear the page [Pa]. [Pa] should be in the range [0..3].
-
-
- Clip (Procedure) TGK_GP
- ──────────────────────────────────────────────────────────────
- Clip(Var X1,Y1,X2,Y2:Integer):Boolean;
-
- Clips the coordinates pairs (X1,Y1) and (X2,Y2) to the current
- viewport. Returns false if clipping could not be applied.
-
-
- ClipLine (Procedure) TGK_GP
- ──────────────────────────────────────────────────────────────
- ClipLine(X1,Y1,X2,Y2:Integer; Color:Byte; Pa:Word);
-
- Draws a line from (X1,Y1) to (X2,Y2) on page [Pa], using color
- [Color]. Will clip to the current viewport. If you do not want
- to use clipping, use Line instead. This was done to allow for
- high-speed linedrawing.
-
-
- ClipObject (Function) TGK_3D
- ──────────────────────────────────────────────────────────────
- ClipObject(Nr:Word; XMin,XMax,YMin,YMax:Integer):ClipType;
-
- Returns one of the values defined in ClipType. If the object
- [Nr] does not clip with the rectangular area as specified by
- (XMin,YMin)-(XMax,YMax), ClipNone is returned, otherwise, a
- value in the range ClipLeft..ClipBottom is returned. For more
- info on the clipping-constants available, look under ClipType.
-
-
- ClipType (Type) TGK_3D
- ──────────────────────────────────────────────────────────────
- ClipType = (ClipNone,ClipLeft,ClipRight,ClipTop,ClipBottom);
-
- This variable of this type is returned by the procedure Clip-
- Object to determine if any clipping occurs for an object.
-
-
- CloneAnimation (Procedure) TGK_ANIM
- ──────────────────────────────────────────────────────────────
- CloneAnimation(Var SourceAnim,DestAnim:AnimType);
-
- CloneAnimation clones the animation in [SourceAnim] to the one
- in DestAnim. That is, they both share the same frames but
- their actual behaviour may differ. This saves a lot of memory.
- Actually, if a 10Kb animation is cloned, this will only eat up
- approximately 50 more bytes of memory. Both animations need to
- be initialized through the use of InitAnimation and it's
- usually good practice to have a previously loaded or cloned
- animation available in [SourceAnim] 8-)
-
-
- CloseGraphics (Procedure) TGK_MAIN
- ──────────────────────────────────────────────────────────────
-
- This procedure shuts down the G∙A∙M∙E graphicsmode. It's not
- necessary but good practice to call this program before your
- program exits to DOS. If you do not call it explicitly,
- G∙A∙M∙E's own de-initialization code will call it.
-
-
- CloseWindow (Procedure) TGK_WIN
- ──────────────────────────────────────────────────────────────
- CloseWindow(Var Window:WindowType);
-
- Closes the previously opened window [Window]. If the window
- wasn't open, nothing happens.
-
-
- CopyPage (Procedure) TGK_MAIN
- ──────────────────────────────────────────────────────────────
- CopyPage(SourcePa,DestPa:Word);
-
- This procedure will copy the contents of page [SourcePa] to
- page [DestPa]. Both [SourcePa] and [DestPa] should be in the
- range [0..3].
-
-
- CtrlPressed (Function) TGK_IO
- ──────────────────────────────────────────────────────────────
- CtrlPressed : Boolean;
-
- Returns true if the Ctrl-Key is currently being pressed.
-
-
- CurPage (Variable) TGK_MAIN
- ──────────────────────────────────────────────────────────────
- CurPage : Word;
-
- This variable is merely here to allow for a certain compatibi-
- lity amongst your programs. If you always use this variable to
- point to the page you're drawing on, you can be use that a
- procedure from another program will know what page to draw to
- as well. Do with it what you want. I just use it ;-)
-
-
- DACDevice (Variable) TGK_SND
- ──────────────────────────────────────────────────────────────
- DACDevice : SoundDevice = [Current Digital-Sound-Device];
-
- This variable will always reflect the active digital-sound-
- playback-device, which can be either Speaker, Adlib, Covox or
- SoundBlaster. Btw, DACDevice is short for "Digital to Analog
- Converter"-Device.
-
-
- DefaultCursor (Const) TGK_IO
- ──────────────────────────────────────────────────────────────
- DefaultCursor : MouseStruct = (...);
-
- This constant can be used as a paramter to SetMouseCursor to
- restore the default shape of the mousecursor at any time.
-
-
- DefaultExtension (Procedure) TGK_FILE
- ──────────────────────────────────────────────────────────────
- DefaultExtension(Var FileName:String; Extension:String);
-
- Will add the extension [Extension] to [FileName] only if
- [FileName] currently does NOT HAVE an extension.
-
-
- DefaultTextSettings (Procedure) TGK_TEXT
- ──────────────────────────────────────────────────────────────
-
- Restores all the textsettings to their default state and
- values. Textspacing will be set to 2 pixels, textsize will be
- restored to 100 (normal size), the internal font becomes the
- active font, proportional-spacing will be set to true, hori-
- zontal justification will be [Left], vertical justification
- [Top] and the textmode will be set to [Speed].
-
-
- DimmerLine (Procedure) TGK_GP
- ──────────────────────────────────────────────────────────────
- DimmerLine(X1,Y1,X2,Y2:Integer; Color:Byte; Pa:Word);
-
- Draws a line from (X1,Y1) to (X2,Y2) on page [Pa], giving it a
- "dimmer" appeal. This will only work correctly when using the
- default G∙A∙M∙E color-palette. [Color] specifies the color to
- be used when underlying pixels have a value of zero. Use
- BrighterLine as a contrastive procedure. Will either clip to
- the current viewport boundaries or not, depending on the
- setting of LineClipping.
-
-
- DimmerPixel (Procedure) TGK_GP
- ──────────────────────────────────────────────────────────────
- DimmerPixel(X,Y:Integer; Color:Byte; Pa:Word);
-
- Gives the pixel at position (X,Y) on page [Pa] a "dimmer"
- appeal. This will only work correctly when using the default
- G∙A∙M∙E color-palette. [Color] specifies the color to be used
- when the underlying pixel has a value of zero. Use Brighter-
- pixel as a contrastive procedure. Will clip to the current
- viewport boundaries.
-
-
- Direction (Type) TGK_GP
- ──────────────────────────────────────────────────────────────
- Direction = (Up,Down,Left,Right);
-
- This is a type used in conjunction with ScrollPage to specify
- one of four directions to move in.
- For example: ScrollPage(0,Down,1,10) will scroll page 0 down
- for 1 pixel and fill with color 10.
-
-
- DisableKeyboard (Procedure) TGK_IO
- ──────────────────────────────────────────────────────────────
-
- Completely disables the keyboard. No user input via the key-
- board is possible until a call to EnableKeyboard is made.
-
-
- DisposeAllFonts (Procedure) TGK_TEXT
- ──────────────────────────────────────────────────────────────
-
- Frees up the memory used by all of the loaded user-fonts. Only
- the default font remains active.
-
-
- DisposeAllObjects (Procedure) TGK_3D
- ──────────────────────────────────────────────────────────────
-
- Disposes of all the active vector-objects.
-
-
- DisposeAnimation (Procedure) TGK_BM
- ──────────────────────────────────────────────────────────────
- DisposeAnimation(Var Animation:AnimType);
-
- Frees up any memory used by the animation [Animation] and re-
- initalizes it. Should be called before program-termination or
- when it's needed to free up some memory on the heap. It's good
- practise to call this procedure after you know you won't have
- any use for this animation anymore. Note: Cloned animations do
- not have to be disposed.
-
-
- DisposeFont (Procedure) TGK_TEXT
- ──────────────────────────────────────────────────────────────
- DisposeFont(Nr:Byte);
-
- Frees up any memory used by the font loaded into slot [Nr].
- [Nr] must be in the range 1..5 and if no font whatsoever has
- been previously loaded into the specified slot, nothing hap-
- pens.
-
-
- DisposeMusic (Procedure) TGK_SND
- ──────────────────────────────────────────────────────────────
- DisposeMusic(Var MusicData:MusicType);
-
- Frees up the memory used by the musical-score loaded into
- [MusicData], if any.
-
-
- DisposeObject (Procedure) TGK_3D
- ──────────────────────────────────────────────────────────────
- DisposeObject(Nr:Word);
-
- Disposes of the vector-object [Nr]. [Nr] must be in the range
- 1..50 and the object must have been previously initalized
- through a call to InitObject. This procedure should be called
- after you're finised using the object.
-
-
- DisposeSample (Procedure) TGK_SND
- ──────────────────────────────────────────────────────────────
- DisposeSample(Var Sample:SampleType);
-
- Frees up the memory used by the digital-sound loaded into
- [Sample], if any.
-
-
- DisposeSprite (Procedure) TGK_BM
- ──────────────────────────────────────────────────────────────
- DisposeSprite(Var Sprite:SpriteType);
-
- Frees up any memory used by sprite [Sprite] and re-initalizes
- it. Should be called before program-termination or when it's
- needed to free up some memory on the heap. It's good practise
- to call this procedure after you know you won't have any use
- for this sprite anymore.
-
-
- DrawObjectFilled (Procedure) TGK_3D
- ──────────────────────────────────────────────────────────────
- DrawObjectFilled(Nr,Pa:Word);
-
- Draws the vector-object [Nr] on page [Pa], filling in all the
- surfaces, using the color and fillstyle specified for each of
- these surfaces with AddSurface.
-
-
- DrawObjectWireFrame (Procedure) TGK_3D
- ──────────────────────────────────────────────────────────────
- DrawObjectWireFrame(Nr,Pa:Word);
-
- Draws the vector-object [Nr] on page [Pa], using a "connect-
- the-dots"-system, drawing lines along the edges of all of the
- surfaces that have been created. The color specified using
- WireColor will be used.
-
-
- Ellipse (Procedure) TGK_GP
- ──────────────────────────────────────────────────────────────
- Ellipse(X,Y,XRadius,YRadius:Integer; Color,Pa:Byte);
-
- Draws an ellipse on page [Pa], using color [Color]. The
- ellipse will be centered at (X,Y) and have a horizontal radius
- of [XRadius] and a vertical radius of [YRadius] pixels. Will
- clip to the current viewport.
-
-
- EnableKeyboard (Procedure) TGK_IO
- ──────────────────────────────────────────────────────────────
-
- Re-enables a previously, through a call to DisableKeyboard,
- disabled keyboard (otherwise, it has no effect at all...).
-
-
- Error (Procedure) TGK_MAIN
- ──────────────────────────────────────────────────────────────
- Error(Message:String);
-
- A call to Error shuts down the G∙A∙M∙E graphics mode, displays
- the [Message] on screen and terminates the program.
-
-
- Exist (Function) TGK_FILE
- ──────────────────────────────────────────────────────────────
- Exist(FileName:String):Boolean;
-
- Returns true if the file named [FileName] exists on disk.
-
-
- Extension (Function) TGK_FILE
- ──────────────────────────────────────────────────────────────
- Extension(FileName:String):String;
-
- Returns the extension of the filename specified in [FileName].
- If [FileName] has no extension, an empty string is returned.
-
-
- FadeFromBlack (Procedure) TGK_MAIN
- ──────────────────────────────────────────────────────────────
- FadeFromBlack(Speed:Byte);
-
- Fades in the entire palette from black at the speed specified
- by [Speed]. [Speed] should be in the range [0..255], where 0
- is fastest speed and 255 slowest speed.
-
-
- FadeFromColor (Procedure) TGK_MAIN
- ──────────────────────────────────────────────────────────────
- FadeFromColor(Color,Speed:Byte);
-
- Fades in the entire palette from the color specified by
- [Color] at the speed specified by [Speed]. If you want to make
- sure you fade from an absolute colorvalue, have a look at the
- code presented under SetColorPal. [Speed] should be in the
- range [0..255], where 0 is fastest speed and 255 slowest
- speed.
-
-
- FadeFromWhite (Procedure) TGK_MAIN
- ──────────────────────────────────────────────────────────────
- FadeFromWhite(Speed:Byte);
-
- Fades in the entire palette from white at the speed specified
- by [Speed]. [Speed] should be in the range [0..255], where 0
- is fastest speed and 255 slowest speed.
-
-
- FadeToBlack (Procedure) TGK_MAIN
- ──────────────────────────────────────────────────────────────
- FadeToBlack(Speed:Byte);
-
- Fades the entire palette to black at the speed specified by
- [Speed]. [Speed] should be in the range [0..255], where 0 is
- fastest speed and 255 slowest speed.
-
-
- FadeToColor (Procedure) TGK_MAIN
- ──────────────────────────────────────────────────────────────
- FadeToColor(Color,Speed:Byte);
-
- Fades the entire palette to the color specified by [Color] at
- the speed specified by [Speed]. If you want to make sure you
- fade to an absolute colorvalue, have a look at the code pre-
- sented under SetColorPal. [Speed] should be in the range
- [0..255], where 0 is fastest speed and 255 slowest speed.
-
-
- FadeToWhite (Procedure) TGK_MAIN
- ──────────────────────────────────────────────────────────────
- FadeToWhite(Speed:Byte);
-
- Fades the entire palette to white at the speed specified by
- [Speed]. [Speed] should be in the range [0..255], where 0 is
- fastest speed and 255 slowest speed.
-
-
- FCircle (Procedure) TGK_GP
- ──────────────────────────────────────────────────────────────
- FCircle(X,Y,Radius:Integer; Color,Pa:Byte);
-
- Draws a filled circle on page [Pa], using color [Color] and
- the current fillstyle. The circle will be centered at (X,Y)
- and have a radius of [Radius] pixels. Will clip to the current
- viewport.
-
-
- FEllipse (Procedure) TGK_GP
- ──────────────────────────────────────────────────────────────
- FEllipse(X,Y,XRadius,YRadius:Integer; Color,Pa:Byte);
-
- Draws a filled ellipse on page [Pa], using color [Color] and
- the current fillstyle. The ellipse will be centered at (X,Y)
- and have a horizontal radius of [XRadius] and a vertical
- radius of [YRadius] pixels. Will clip to the current viewport.
-
-
- FileWindow (Function) TGK_WIN
- ──────────────────────────────────────────────────────────────
- FileWindow(X,Y,Pa:Word; Title,FileSpec:String) : String;
-
- Pops up a file-selection-window entitled [Title] at position
- (X,Y) on page [Pa]. [FileSpec] determines which files you can
- pick from. The file chosen will be returned as the function
- result. If no file was chosen, ie. the window was cancelled,
- an empty string will be returned. Example:
-
- Var PasFile : String;
-
- PasFile:=FileWindow(10,10,0,'Pick a Pascal-File:','*.PAS');
-
-
- FillPage (Procedure) TGK_MAIN
- ──────────────────────────────────────────────────────────────
- FillPage(Pa:Word;Color:Byte);
-
- Fills the contents of page [Pa] with the color specified in
- [Color]. [Pa] should be in the range [0..3] and color should
- be in the range [0..255].
-
-
- FillPatType (Type) TGK_MAIN
- ──────────────────────────────────────────────────────────────
- FillPatType = Array[0..15,0..15] of Byte;
-
- Type used in combination with the procedure SetUserFill. This
- array may be regarded as a simple bitmap. Each (x,y)-pair in
- the array simply specifies the color for that point in the
- fillpattern. Thus, to create sort of a diagonal, gray-shaded
- fill, you could use a piece of code like this:
-
- Var MyFill : FillPatType;
- X,Y : Byte;
-
- For X:=0 To 15 Do
- For Y:=0 To 15 Do MyFill[X,Y]:=15+(X+Y) Mod 16;
-
-
- FPoly (Procedure) TGK_GP
- ──────────────────────────────────────────────────────────────
- FPoly(NrPoints:Integer; Var Points; Color:Byte; Pa:Word);
-
- Draws a filled polygon on page [Pa], using color [Color] and
- the current fillstyle. Will clip to the current viewport.
- [NrPoints] specifies the number of coordinate-pairs in the
- polygon and [Points] is an untyped variable containing an
- array of (X,Y) coordinate-pairs. Let me demonstrate how all
- this works:
-
- Const Form : Array[1..3,1..2] of Integer =
- ((100,100),
- (150,120),
- (110,160));
-
- FPoly(3,Form,10,0);
-
- This will draw a filled (triangular) polygon on page 0, using
- color 10 and the three coordinates as specified in the array
- [Form].
-
-
- FrameRec (Type) TGK_ANIM
- ──────────────────────────────────────────────────────────────
- FrameRec = Array[1..50] of Record
- Bitmap : Pointer;
- BMSize : Word;
- X,Y : Integer;
- XSize,YSize : Word;
- End;
-
- FrameType is a subtype used by [AnimType] to store the infor-
- mation for one animation frame. [Bitmap] contains the actual
- data for a frame, which is sized at [BMSize] bytes. [X] and
- [Y] specify the relative offset of this frame from the (X,Y)-
- position of the animation, whereas [XSize] and [YSize] respec-
- tively contain the horizontal and vertical number of pixels in
- the [Bitmap].
-
-
- FRectangle (Procedure) TGK_GP
- ──────────────────────────────────────────────────────────────
- FRectangle(X1,Y1,X2,Y2:Integer; Color:Byte; Pa:Word);
-
- Draws a filled rectangle on page [Pa], using color [Color] and
- the current fillstyle. The coordinate-pair (X1,Y1) denotes the
- upperleft corner of the rectangle, whereas (X2,Y2) denotes the
- lowerright corner. Clips to the current viewport.
-
-
- FSquare (Procedure) TGK_GP
- ──────────────────────────────────────────────────────────────
- FSquare(X1,Y1,Size:Integer; Color:Byte; Pa:Word);
-
- Draws a filled square on page [Pa], using color [Color] and
- the current fillstyle. The coordinate-pair (X1,Y1) denotes the
- upperleft corner of the square, whereas (X1+Size,Y1+Size)
- denotes the lowerright corner. Clips to the current viewport.
-
-
- FTriangle (Procedure) TGK_GP
- ──────────────────────────────────────────────────────────────
- FTriangle(Triangle:TriangleType; Pa:Word);
-
- Draws a filled triangle as specified in [Triangle] on page
- [Pa], using the current fillstyle. Will clip to the current
- viewport. For more info on how a variable of type TriangleType
- is built up, have a look under the TriangleType header.
-
-
- FullMouseRange (Procedure) TGK_IO
- ──────────────────────────────────────────────────────────────
-
- Sets the mouse-boundaries to use the entire screen, that is
- (0,0)-(319,199).
-
-
- FullPort (Procedure) TGK_MAIN
- ──────────────────────────────────────────────────────────────
-
- A call to FullPort will restore the ViewPort to full size,
- that is the whole screen or (0,0)-(319,199).
-
-
- FunctionKey (Function) TGK_IO
- ──────────────────────────────────────────────────────────────
- FunctionKey : Boolean;
-
- Returns true if the first key waiting in the keyboardbuffer is
- a functionkey.
-
-
- GamePort (Function) TGK_IO
- ──────────────────────────────────────────────────────────────
- GamePort : Boolean;
-
- Returns true if a gameport is installed.
-
-
- GetColor ( Procedure) TGK_MAIN
- ──────────────────────────────────────────────────────────────
- GetColor(Nr:Byte; Var Entry:RGBEntry);
-
- Returns the respective red, green and blue values for palette
- entry [Nr] in a variable of type RGBEntry. For some code, have
- a look at SetColor.
-
-
- GetImage (Procedure) TGK_BM
- ──────────────────────────────────────────────────────────────
- GetImage(X1,Y1,X2,Y2:Integer;
- Var Sprite:SpriteType; Pa:Word);
-
- GetImage will grab the contents of the rectangular area speci-
- fied by the X- and Y-coordinates into the sprite [Sprite],
- from page [Pa]. Before calling this procedure, [Sprite] needs
- to be initialized using InitSprite. [Pa] should be in the
- range [0..3]. You are free to choose the X- and Y-coordinates,
- but they will clip to the current viewport.
-
-
- GetJoyButton (Function) TGK_IO
- ──────────────────────────────────────────────────────────────
- GetJoyButton(JoyNr:Byte; Button:JoyButtonType):Boolean;
-
- Returns true if the button specified in [Button] is currently
- being pressed on the joystick specified in [JoyNr]. [JoyNr]
- must be either 1 or 2 and [Button] is of type JoyButtonType,
- which is described in more detail under JoyButtonType.
-
-
- GetJoyDirection (Function) TGK_IO
- ──────────────────────────────────────────────────────────────
- GetJoyDirection(JoyNr:Byte):JoyDirection;
-
- Returns a function result of type [JoyDirection], reflecting
- the current direction of joystick [JoyNr]. [JoyNr] must be
- either 1 or 2. For a more detailed description of the type
- [JoyDirection], look under JoyDirection.
-
-
- GetJoyPosition (Function) TGK_IO
- ──────────────────────────────────────────────────────────────
- GetJoyPosition(JoyNr:Byte; Axis:JoyPosType):Integer;
-
- Returns the current joystickposition for joystick [JoyNr] on
- the axis [Axis]. [JoyNr] must be either 1 or 2 and [Axis] is
- of type JoyPosType, which is described in more detail under
- JoyPosType.
-
-
- GetMouseMotion (Procedure) TGK_IO
- ──────────────────────────────────────────────────────────────
- GetMouseMotion(Var Horizontal,Vertical:Integer);
-
- Return the number of pixels the mouse moved, since the last
- coordinates passed by the mousedriver, in both [Horizontal]
- and [Vertical] directions.
-
-
- GetMouseSettings (Procedure) TGK_IO
- ──────────────────────────────────────────────────────────────
- GetMouseSettings(Var MouseInfo:MouseSettingsType);
-
- Returns the current mousestatus and settings. For more infor-
- mation, have a look at the description of MouseSettingsType.
-
-
- GetPalette (Procedure) TGK_MAIN
- ──────────────────────────────────────────────────────────────
- GetPalette(Var Palette);
-
- Returns the actual palette in any structure denoted to by
- [Palette]. It is, however, good practice to use the G∙A∙M∙E
- PaletteType as the default structure, as this will assure
- compatibility with other procedures and functions.
-
-
- GetPixel (Function) TGK_GP
- ──────────────────────────────────────────────────────────────
- GetPixel(X,Y:Integer; Pa:Word):Byte;
-
- Returns the value of the pixel at coordinates (X,Y) on page
- [Pa]. Returns a value of zero for pixels located outside of
- the viewport.
-
-
- GetTextSettings (Procedure) TGK_TEXT
- ──────────────────────────────────────────────────────────────
- GetTextSettings(Var Settings:TextSettingsType);
-
- Saves all important textsettings, such as the active font,
- character spacing, whether proportional spacing is active,
- horizontal and vertical justification and the textmode in a
- record pointed to by [Settings]. After a call to this procedu-
- re, one can fiddle around with the textsetting and at a later
- moment in time restore the old settings through a call to
- SetTextSettings, which uses the previously saved textsettings-
- record to restore the old settings.
-
-
- GetWindowColors (Procedure) TGK_WIN
- ──────────────────────────────────────────────────────────────
- GetWindowColors(Var ColorSet:WindowColorSet);
-
- Retrieves the current color selection for the windows. For a
- more detailed explanation, look under WindowColorSet.
-
-
- GlobalVol (Variable) TGK_SND
- ──────────────────────────────────────────────────────────────
- GlobalVol : Real = [The current overall-volume...];
-
- This variable contains a value in the range 0..1, reflecting
- the current overall-volume of the FM-Music routines (thus, the
- digital-sound-routines are not affected by this value). Set it
- to 1.0 for full volume, to 0.5 for about 25% of the original
- volume.
-
-
- GoodName (Procedure) TGK_FILE
- ──────────────────────────────────────────────────────────────
-
- As for now, this procedure is for internal use by the G∙A∙M∙E
- program only.
-
-
- HandleAnimation (Procedure) TGK_ANIM
- ──────────────────────────────────────────────────────────────
- HandleAnimation(Var Animation:AnimType; Pa:Word);
-
- Updates all the necessary parameters for the movement and
- behaviour of animation [Animation] and, if required, displays
- it on page [Pa]. If UseMask is set to true, it will use the
- mask-page, otherwise it won't.
-
-
- HandleWindow (Procedure) TGK_WIN
- ──────────────────────────────────────────────────────────────
- HandleWindow(Var Window:WindowType):Word;
-
- Checks to see if any buttons are being pressed for window
- [Window]. If so, the number of the button on which the action
- was performed will be returned. If zero (0) is returned, the
- window has been closed using the close button.
-
-
- HideObject (Procedure) TGK_3D
- ──────────────────────────────────────────────────────────────
- HideObject(Nr:Word);
-
- Marks the non-visible-part of vector-object [Nr]. This proce-
- dure should be called before displaying the object. It will
- cause the non-visible surfaces not to be drawn, creating a
- much more life-like and professional appearance.
-
-
- HLine (Procedure) TGK_GP
- ──────────────────────────────────────────────────────────────
- HLine(X1,Y1,X2:Integer; Color:Byte; Pa:Word);
-
- Draws a horizontal line from (X1,Y1) to (X2,Y1) on page [Pa],
- using color [Color]. Clips to the current viewport.
-
-
- InitAnimation (Procedure) TGK_BM
- ──────────────────────────────────────────────────────────────
- InitAnimation(Var Animation:AnimType);
-
- Initializes the animation [Animation] for use with G∙A∙M∙E.
- Should be called before doing anything with the animation.
-
-
- InitFile (Function) TGK_FILE
- ──────────────────────────────────────────────────────────────
- InitFile(Var FileHandle:File; FileName:String;
- Var FSize:LongInt):Boolean;
-
- This procedure is used to open a file no matter in what subdi-
- rectory it resides and whether or not it resides in a G∙A∙M∙E
- resource-file. If found, the file named [FileName] will be
- assigned to the handle [FileHandle] and be opened. If the file
- resides in a resource-file, the file-pointer will be located
- at the start of the needed data. The size of the data will be
- returned in [FSize].
- When you write your own procedures using this function, please
- notice that if your file was found inside of a resource-file,
- Turbo Pascal functions such as FileSize and Seek will not work
- properly. Therefore, the filesize is returned in [FSize] and
- you should always do a relative seek, such as Seek(MyFile,Fi-
- lePos(MyFile)+10) instead of Seek(MyFile,10).
-
-
- InitMouse (Procedure) TGK_IO
- ──────────────────────────────────────────────────────────────
-
- Tries to initialize the mouse for use with G∙A∙M∙E. If succes-
- ful, MouseDriver will be set to true and NrOfButtons will
- contain the number of buttons found on your mouse.
-
-
- InitMusic (Procedure) TGK_SND
- ──────────────────────────────────────────────────────────────
- InitMusic(Var MusicData:MusicType);
-
- Initializes [MusicData], a variable of type MusicType, for use
- with G∙A∙M∙E. This procedure must be called before doing
- anything else with the [MusicData] variable.
-
-
- InitObject (Procedure) TGK_3D
- ──────────────────────────────────────────────────────────────
- InitObject(Nr:Word);
-
- Initializes the vector-object [Nr] for use with G∙A∙M∙E. [Nr]
- must be in the range 1..50. This should be the first call you
- make before doing anything else with the object.
-
-
- InitSample (Procedure) TGK_SND
- ──────────────────────────────────────────────────────────────
- InitSample(Var Sample:SampleType);
-
- Initializes [Sample], a variable of type SampleType, for use
- with G∙A∙M∙E. This procedure must be called before doing
- anything else with the [Sample] variable.
-
-
- InitSprite (Procedure) TGK_BM
- ──────────────────────────────────────────────────────────────
- InitSprite(Var Sprite:SpriteType);
-
- Initializes the sprite [Sprite] for use with G∙A∙M∙E. Should
- be called before doing anything else with the sprite.
-
-
- InitWindow (Procedure) TGK_WIN
- ──────────────────────────────────────────────────────────────
- InitWindow(Var Window:WindowType;
- X,Y,XSize,YSize:Integer; Title:String);
-
- Initializes the window [Window] for use with G∙A∙M∙E. When
- opened the window will be placed at the coordinates (X,Y),
- will be [XSize] pixels in size horizontally, [YSize] pixels
- vertically and have a title as specified in [Title]. This
- should be your first call when using a new variable of type
- WindowType.
-
-
- IsBusy (Variable) TGK_MAIN
- ──────────────────────────────────────────────────────────────
- IsBusy : Boolean;
-
- This variable is used in conjunction with interrupt procedu-
- res. Suppose you've got a procedure that will change the shape
- of your mousecursor every 10th of a second, to a allow for an
- animated mousecursor. Who guaranties that when you interrupt
- the program to draw the new cursor, it wasn't already drawing
- something else? This is where the IsBusy variable is introdu-
- ced. When it's set to true, the program is currently drawing
- to the screen and thus shouldn't be interrupted. Just wait
- until it's false and then execute your procedure. Yes, you've
- guessed it; It's a good idea to set IsBusy to true when dra-
- wing your new mousecursor so no other interrupt-procedure will
- mess up what you're doing... However, do not forget to set it
- to false after you're finished or otherwise the next operation
- that writes to the screen won't output much...
-
-
- JoyButtonType (Type) TGK_IO
- ──────────────────────────────────────────────────────────────
- JoyButtonType = (JoyLeftBut,JoyRightBut);
-
- This type is used in conjunction with GetJoyButton to detect
- whether the left or right joystick button is pressed.
-
-
- JoyDirection (Type) TGK_IO
- ──────────────────────────────────────────────────────────────
- JoyDirection = (LeftDir,RightDir,UpDir,DownDir,
- NoDir,UpLeftDir,UpRightDir,
- DownLeftDir,DownRightDir);
-
- This type is returned as a function result for GetJoyDirection
- and reflects the current direction for a joystick.
-
-
- JoyPosType (Type) TGK_IO
- ──────────────────────────────────────────────────────────────
- JoyPosType = (XPosition,YPosition);
-
- This type is used in conjunction with GetJoyPosistion to
- retrieve the position for either the horizontal or vertical
- axis for a joystick.
-
-
- JoyStickExists (Function) TGK_IO
- ──────────────────────────────────────────────────────────────
- JoyStickExists(JoyNr:Byte):Boolean;
-
- Returns true if joystick [JoyNr] exists. [JoyNr] must be
- either 1 or 2.
-
-
- KeyPressed (Function) TGK_IO
- ──────────────────────────────────────────────────────────────
- KeyPressed : Boolean;
-
- Returns true if a key is waiting in the keyboard buffer.
-
-
- KeyTable (Variable) TGK_IO
- ──────────────────────────────────────────────────────────────
- KeyTable : Array[1..127] of Boolean;
-
- Each position in this table reflects the current state of a
- key on the keyboard. If set to true, the key is currently
- down, otherwise it isn't. For a complete list of keyboard
- scancodes, have a look at Appendix A: Keyboard scancodes.
- It really is pretty simple to use this table. For example, to
- have your program wait until the user presses the ESC-key,
- simple use some code like this:
-
- While Not KeyTable[1] do;
-
- The fun part about it is that you can detect more than one
- keypress at a time, thus you can simply check for a combinati-
- on of keys being pressed using an AND statement. Try it 8-)
-
-
- LeftButton (Function) TGK_IO
- ──────────────────────────────────────────────────────────────
- LeftButton : Boolean;
-
- Returns true if the left mousebutton is currently down.
-
-
- LeftText (Const) TGK_TEXT
- ──────────────────────────────────────────────────────────────
- LeftText = 0;
-
- Used in conjunction with SetTextJustify, for more information
- on how this procedure works, have a look under the appropriate
- header.
-
-
- Line (Procedure) TGK_GP
- ──────────────────────────────────────────────────────────────
- Line(X1,Y1,X2,Y2:Integer; Color:Byte; Pa:Word);
-
- Draws a line from (X1,Y1) to (X2,Y2) on page [Pa], using color
- [Color]. Will NOT clip to the current viewport. If you want to
- use clipping, use ClipLine instead. This was done to allow for
- high-speed linedrawing.
-
-
- LineClipping (Variable) TGK_GP
- ──────────────────────────────────────────────────────────────
- LineClipping : Boolean;
-
- When set to true, certain procedures in the TGK_GP-unit will
- clip to the current viewport. When set to false, they won't.
- Set to false for speedier line-drawing procedures when you are
- sure they won't cross the viewport-boundaries.
-
-
- LoadAnimation (Procedure) TGK_ANIM
- ──────────────────────────────────────────────────────────────
- LoadAnimation(Var Animation:AnimType; FileName:String);
-
- This procedure will load a previously stored animation from
- disk into [Animation]. [Animation] should first be initialized
- by issuing a call to InitAnimation. The extension for [FileNa-
- me] defaults to [.GAF], which is short for G∙A∙M∙E Animation
- File.
-
-
- LoadBBM (Procedure) TGK_FILE
- ──────────────────────────────────────────────────────────────
- LoadBBM(FileName:String; Var Sprite:SpriteType);
-
- Loads a "DeLuxe Paint" brush from disk from the file named
- [FileName] into a variable, [Sprite], of type SpriteType that
- must have been previously initialized using InitSprite. If no
- extension is specified, [.BBM] will be assumed.
-
-
- LoadBMP (Procedure) TGK_FILE
- ──────────────────────────────────────────────────────────────
- LoadBMP(FileName:String; Pa:Word);
-
- This procedure will load a previously stored BMP (Windows
- BitMaP) file from disk. The file must be exactly 320 pixels in
- width and 200 pixels in height and use 256 colors. The name of
- the file must be [FileName] and it will be loaded to the page
- specified by [Pa]. If a resource-file is currently active,
- that is, [Resource] has been assigned a name, this procedure
- will try to load the file from the resource. If no extension
- is specified, [.BMP] will be assumed.
-
-
- LoadFont (Procedure) TGK_TEXT
- ──────────────────────────────────────────────────────────────
- LoadFont(Name:String; Nr:Byte);
-
- Will load the font [Name] from disk. If no extension is speci-
- fied, [.GFF] (short for G∙A∙M∙E-Font File) will be assumed.
- [Nr] must be in the range 1..5 and specifies in which userslot
- to load the font. Slot 0 may not be used because this slot
- always contains the internal font. Font can be converted from
- other programs using the GAMEFONT program as discussed in
- chapter 4, paragraph 4.4.
-
-
- LoadGIF (Procedure) TGK_FILE
- ──────────────────────────────────────────────────────────────
- LoadGIF(FileName:String; Pa:Word);
-
- This procedure will load a previously stored GIF (Graphics
- Interchange Format) file from disk. These files can be created
- using various paint-programs and can be found on many diffe-
- rent bulletin boards. If the file is too large to fit on the
- screen it will be cropped to 320 pixels wide and 200 pixels
- high. The name of the file must be [FileName] and it will be
- loaded to the page specified by [Pa]. If a resource-file is
- currently active, that is, [Resource] has been assigned a
- name, this procedure will try to load the file from the re-
- source. If no extension is specified, [.GIF] will be assumed.
-
-
- LoadGPF (Procedure) TGK_FILE
- ──────────────────────────────────────────────────────────────
- LoadGPF(FileName:String; Pa:Word);
-
- This procedure will load a previously stored G∙A∙M∙E-Picture
- File from disk. This file might have been created using the
- GAMECAP screen-capture program or through the use of SaveGPF.
- The name of the file must be [FileName] and it will be loaded
- to the page specified by [Pa]. If a resource-file is currently
- active, that is, [Resource] has been assigned a name, this
- procedure will try to load the file from the resource. If no
- extension is specified, [.GPF] will be assumed.
-
-
- LoadImage (Procedure) TGK_FILE
- ──────────────────────────────────────────────────────────────
- LoadImage(FileName:String; Var Sprite:SpriteType);
-
- Loads a previously saved sprite from disk from the file named
- [FileName] into a variable, [Sprite], of type SpriteType that
- must have been previously initialized using InitSprite. The
- default extension used, if none specified, is [.GSF] (G∙A∙M∙E-
- Sprite File).
-
-
- LoadLBM (Procedure) TGK_FILE
- ──────────────────────────────────────────────────────────────
- LoadLBM(FileName:String; Pa:Word);
-
- This procedure will load a previously stored LBM (Electronic
- Arts' interLeaved BitMap) file from disk. These files can be
- created using various paint-programs. The file must be exactly
- 320 pixels in width and 200 pixels in height and use 256
- colors. The name of the file must be [FileName] and it will be
- loaded to the page specified by [Pa]. If a resource-file is
- currently active, that is, [Resource] has been assigned a
- name, this procedure will try to load the file from the re-
- source. If no extension is specified, [.LBM] will be assumed.
-
-
- LoadMusic (Procedure) TGK_SND
- ──────────────────────────────────────────────────────────────
- LoadMusic(Var MusicData:MusicType; FileName:String);
-
- Loads a previously stored music-file, named [FileName], from
- disk into the variable [MusicData], which must have been
- previously initialized through a call to InitMusic. The exten-
- sion for [FileName] defaults to [.GMF], which is short for
- G∙A∙M∙E-MusicFile.
-
-
- LoadPath (Procedure) TGK_ANIM
- ──────────────────────────────────────────────────────────────
- LoadPath(Var Animation:AnimType; FileName:String);
-
- Loads a previously stored path from disk into the [Path] for
- [Animation]. The animation must have been initialized through
- a call to InitAnimation. The extension for [FileName] defaults
- to [.PTH], for PaTHfile. For more information on animation-
- paths, look under PathType.
-
-
- LoadPCX (Procedure) TGK_FILE
- ──────────────────────────────────────────────────────────────
- LoadPCX(FileName:String; Pa:Word);
-
- This procedure will load a previously stored PCX-file from
- disk. These files can be created using various paint-programs.
- The file must be exactly 320 pixels in width and 200 pixels in
- height and use 256 colors. The name of the file must be [File-
- Name] and it will be loaded to the page specified by [Pa]. If
- a resource-file is currently active, that is, [Resource] has
- been assigned a name, this procedure will try to load the file
- from the resource. If no extension is specified, [.PCX] will
- be assumed.
-
-
- LoadSample (Procedure) TGK_SND
- ──────────────────────────────────────────────────────────────
- LoadSample(Var Sample:SampleType;
- FileName:String; Signed:Boolean);
-
- Loads a previously stored digital-sound, named [FileName],
- from disk into the variable [Sample], which must have been
- previously initialized through a call to InitSample. The
- extension for [FileName] defaults to [.GSF], which is short
- for G∙A∙M∙E-SampleFile. [Signed] specifies whether the sample
- is in unsigned- (IBM, SoundBlaster) or signed-format (Amiga).
- Samples that come from MOD-files are signed, for example.
-
-
- LongDiv (Function) TGK_MAIN
- ──────────────────────────────────────────────────────────────
- LongDiv(X:LongInt; Y:Integer):Integer;
-
- Divides the longint [X] by the value in [Y] and returns an
- integer function result. Merely included for speed, as it is a
- lot faster than Turbo's default longint division.
-
-
- LongMod (Function) TGK_MAIN
- ──────────────────────────────────────────────────────────────
- LongMod(X:LongInt; Y:Integer):Integer;
-
- Divides the longint [X] by the value in [Y] and returns the
- remainder of this division as an integer function result.
- Merely included for speed, as it is a lot faster than Turbo's
- default function.
-
-
- LongMul (Function) TGK_MAIN
- ──────────────────────────────────────────────────────────────
- LongMul(X,Y:Integer):LongInt;
-
- Performs multiplication of the two integer variables [X] and
- [Y} and returns a longint. Merely included for speed, as it is
- a lot faster than Turbo's default longint multiplication.
-
-
- LShiftPressed (Function) TGK_IO
- ──────────────────────────────────────────────────────────────
- LShiftPressed : Boolean;
-
- Returns true if the Left Shift-Key is currently being pressed.
-
-
- MaxButtons (Constant) TGK_WIN
- ──────────────────────────────────────────────────────────────
- MaxButtons = 30;
-
- This constant reflects the highest button-number that can be
- added to a window using any of the AddButton functions, such
- as AddPushButton and AddCheckButton. Any value higher than
- MaxButtons passed to these procedures will cause them to
- terminate without doing anything.
-
-
- MessageWindow (Procedure) TGK_WIN
- ──────────────────────────────────────────────────────────────
- MessageWindow(X,Y,Pa:Word; Message:String);
-
- Pops up a message-window at position (X,Y) on page [Pa]. The
- message [Message] will be displayed. Adding a #13 (CR) in the
- message will cause the text-display to wrap around to the next
- line at that position. An example:
-
- MessageWindow(10,10,0,'This will be on the first'#13+
- 'and this on the second line...');
-
-
- MiddleButton (Function) TGK_IO
- ──────────────────────────────────────────────────────────────
- MiddleButton : Boolean;
-
- Returns true if the middle mousebutton is currently down. Try
- avoiding the use of this function because not all mouses have
- three buttons and hey, two is more than enough almost always.
- Remember those Apple-guys? They've got only one ;-) (Which
- could be called the middle button, I know... but it's the left
- as well AND the right!) Thiz sucks...
-
-
- MinX, MinY, MaxX and MaxY (Variable) TGK_MAIN
- ──────────────────────────────────────────────────────────────
-
- These variables define the actual viewport for all graphics
- operations. Do not alter them directly but only through the
- use of SetViewPort and FullPort.
-
-
- ModeType (Type) TGK_SND
- ──────────────────────────────────────────────────────────────
- ModeType = (Melodic,Percussive);
-
- Used by the procedure SetMode. For more information look under
- the appropriate header.
-
-
- MoveObject (Procedure) TGK_3D
- ──────────────────────────────────────────────────────────────
- MoveObject(Nr:Word; X,Y,Z:Integer);
-
- Moves the position in 3D-Space for vector-object [Nr]. This is
- done relatively to it's current position for [X], [Y] and [Z]
- pixels along the respective axes.
-
-
- MoveOrigin (Procedure) TGK_3D
- ──────────────────────────────────────────────────────────────
- MoveOrigin(Nr:Word; X,Y:Integer);
-
- Moves the position on screen for vector-object [Nr] relatively
- to it's current position for [X] pixels along the horizontal
- axis and [Y] pixels along the vertical axis.
-
-
- MouseCursorOff (Procedure) TGK_IO
- ──────────────────────────────────────────────────────────────
-
- Turns off the mousecursor.
-
-
- MouseCursorOn (Procedure) TGK_IO
- ──────────────────────────────────────────────────────────────
-
- Turns on the mousecursor. The G∙A∙M∙E graphics mode must have
- been previously initialized through a call to OpenGraphics and
- the mouse must have been previously initialized through a call
- to InitMouse.
-
-
- MouseDriver (Const) TGK_IO
- ──────────────────────────────────────────────────────────────
- MouseDriver : Boolean;
-
- This constant reflects whether a mousedriver is installed or
- not. If set to true, a mousedriver was found, otherwise no
- mousedriver could be detected.
-
-
-
- MouseIn (Function) TGK_IO
- ──────────────────────────────────────────────────────────────
- MouseIn(X1,Y1,X2,Y2:Integer) : Boolean;
-
- Return true if the current mouse-coordinates fall within the
- rectangular area defined by [X1], [Y1], [X2] and [Y2].
-
-
- MouseMoved (Function) TGK_IO
- ──────────────────────────────────────────────────────────────
-
- Returns true if the mouse-coordinates have changes since the
- last ones passed by the mousedriver.
-
-
- MousePointer (Variable) TGK_IO
- ──────────────────────────────────────────────────────────────
- MousePointer : Boolean;
-
- This boolean reflects the current state of the mousecursor. If
- the mousecursor is visible, it is set to true, otherwise it is
- false.
-
-
- MouseSettingsType (Type) TGK_IO
- ──────────────────────────────────────────────────────────────
-
- This type is of no further interest to the user but is used by
- GetMouseSettings and SetMouseSettings to respectively save and
- restore the state of the mouse. Important things such as the
- state of the mousecursor, the current viewport for the mouse
- and special range are stored in this type.
-
-
- MouseStruct (Type) TGK_IO
- ──────────────────────────────────────────────────────────────
- MouseStruct = Array[0..19,0..19] of Byte;
-
- This type is used in conjunction with SetMouseCursor. Each
- (X,Y)-position in the array reflects the colorvalue for that
- pixel of the mouse cursor. Thus, this array can be regarded as
- a simple bitmap for the shape of the mousecursor.
-
-
- MouseX and MouseY (Variable) TGK_IO
- ──────────────────────────────────────────────────────────────
- MouseX,MouseY : Integer;
-
- These variables reflect the current X- and Y-coordinate of the
- mousecursor. They can, but normally shouldn't, be changed by
- the user.
-
-
- MoveBlock (Procedure) TGK_MAIN
- ──────────────────────────────────────────────────────────────
- MoveBlock(X1,Y1,X2,Y2:Integer; SourcePa,DestPa:Word);
-
- A call to MoveBlock will copy the contents of the rectangular
- area specified by [X1], [Y1], [X2] and [Y2] from page [Source-
- Pa] to page [DestPa]. You are free to choose the rectangular
- area, but it will be clipped to the screen boundaries. Both
- [SourcePa] and [DestPa] should be in the range [0..3].
-
-
- MusHdr (Type) TGK_SND
- ──────────────────────────────────────────────────────────────
- MusHdr = Record [...];
-
- This is a subtype used by the MusicType type. It is of no
- further interest to the user.
-
-
- MusicDevice (Variable) TGK_SND
- ──────────────────────────────────────────────────────────────
- MusicDevice : SoundDevice = [Current Music-Device];
-
- This variable will always reflect the active music-playback-
- device, which can be either Speaker, Adlib or SoundBlaster.
-
-
- MusicPlaying (Variable) TGK_SND
- ──────────────────────────────────────────────────────────────
- MusicPlaying : Boolean = [Any music, Maestro?];
-
- [MusicPlaying] reflects the current state of the G∙A∙M∙E FM-
- Music Playback System. If it is currently playing a song, the
- variable [MusicPlaying] will be set to true. Otherwise, it
- will be set to false.
-
-
- MusInfo (Variable) TGK_SND
- ──────────────────────────────────────────────────────────────
- MusInfo : Record
- Note : Array[1..11] of Byte;
- Volume : Array[1..11] of Byte;
- PitchBend : Array[1..11] of Word;
- PercentDone : Byte;
- End;
-
- This record contains useful information about the current FM-
- Music that is playing (if any). The [Note] fields contain the
- current note being played for each of the 11 voices available.
- For more information on note-values, have a look at NoteOn.
- The [Volume] fields contain the relative volume for each voice
- and the [PitchBend] fields the amount of "Pitch-Bending"
- applied to each voice, where 100=Normal Note, 0=Down one note
- and 200=Up one Note. Finally, the [PercentDone] field contains
- a value which indicates how many percent of the song has been
- played.
-
-
- MusType (Type) TGK_SND
- ──────────────────────────────────────────────────────────────
- MusType = Record [...];
-
- This type is used by the various music-playback-routines found
- in TGK_SND. It contains no fields of interest to the user.
-
-
- NewExtension (Procedure) TGK_FILE
- ──────────────────────────────────────────────────────────────
- NewExtension(Var FileName:String; Extension:String);
-
- Changes the extension of [FileName] to [Extension], deleting
- any possible existing extension.
-
-
- NewResource (Procedure) TGK_FILE
- ──────────────────────────────────────────────────────────────
-
- Initializes a new resource file with a filename as specified
- with the [Resource] variable. If the resource already exists,
- you will be prompted whether you want to overwrite the exis-
- ting file or append data to it. There's really not much point
- in using this procedure, unless you would like to create your
- own resource-file maker, such as MAKERES.
-
-
- No (Constant) TGK_WIN
- ──────────────────────────────────────────────────────────────
- No = False;
-
- May be used to test the result of a call to QuestionWindow for
- a negative answer. Alas, it makes your code look neat, but
- there is no further function... 8-)
-
-
- NoSpecialRange (Procedure) TGK_IO
- ──────────────────────────────────────────────────────────────
-
- Removes a previously defined special range for mouse.
-
-
- NoteOff (Procedure) TGK_SND
- ──────────────────────────────────────────────────────────────
- NoteOff(Voice:Byte);
-
- Turns of the currently sounding note (if any) for voice number
- [Voice] on the active music-device. If the active music-device
- is the internal speaker, the [Voice] parameter is a dummy one.
-
-
- NoteOn (Procedure) TGK_SND
- ──────────────────────────────────────────────────────────────
- NoteOn(Note:Word; Voice:Byte);
-
- Turns on a note for voice number [Voice] on the current music-
- device. For Adlib and SoundBlaster, [Voice] must be in the
- range 1..11. If the current music-device happens to be the
- internal speaker, then the [Voice] parameter is of no effect.
- [Note] must be in the range 0..95, corresponding to the keys
- on a piano, with 48 being the "middle-C". There are 12 notes
- per octave. Thus, the total range of 96 notes represents the
- full piano-range of 8 octaves.
-
-
- NrOfButtons (Constant) TGK_IO
- ──────────────────────────────────────────────────────────────
- NrOfButtons : Byte;
-
- This constant reflects the number of buttons on the mouse, if
- a mousedriver was detected, of course.
-
-
- OpenGraphics (Procedure) TGK_MAIN
- ──────────────────────────────────────────────────────────────
-
- Call this procedure before any operation in your program that
- writes to the screen. In general it's good practice to put
- this call right after the initialization-code in your program.
- OpenGraphics will initialize all the necessary variables and
- setup the G∙A∙M∙E graphicsmode.
-
-
- OpenWindow (Procedure) TGK_WIN
- ──────────────────────────────────────────────────────────────
- OpenWindow(Var Window:WindowType; Status:Byte; Pa:Word);
-
- Will open the window [Window] at page [Pa] at the coordinates
- specified using a previous call to InitWindow. The [Status]
- variable contains information on some window-options. For more
- information on what these are, have a look under WDefault,
- WCloseable and WMoveable.
-
-
- Outtext (Procedure) TGK_TEXT
- ──────────────────────────────────────────────────────────────
- Outtext(X,Y:Integer; Color:Byte; Pa:Word; S:String);
-
- Will output the string [S] on page [Pa] at position (X,Y),
- using the active font and textsettings. If the active font is
- a mono-font, that is only one color is used, [Color] will be
- used as the color to draw, otherwise, [Color] is of no effect
- and thus a dummy-parameter.
-
-
- OuttextHLine (Procedure) TGK_TEXT
- ──────────────────────────────────────────────────────────────
- OuttextHLine(X,Y,YPos:Integer; Color:Byte;
- Pa:Word; S:String);
-
- Will output one single line of the string [S] on page [Pa] at
- position (X,Y+YPos), using the active font and textsettings.
- If the active font is a mono-font, that is only one color is
- used, [Color] will be used as the color to draw, otherwise,
- [Color] is of no effect and thus a dummy-parameter.
-
-
- OuttextVLine (Procedure) TGK_TEXT
- ──────────────────────────────────────────────────────────────
- OuttextVLine(X,Y,XPos:Integer; Color:Byte;
- Pa:Word; S:String);
-
- Will output one single row of the string [S] on page [Pa] at
- position (X+XPos,Y), using the active font and textsettings.
- If the active font is a mono-font, that is only one color is
- used, [Color] will be used as the color to draw, otherwise,
- [Color] is of no effect and thus a dummy-parameter.
-
-
- OutTextWave (Procedure) TGK_TEXT
- ──────────────────────────────────────────────────────────────
- OutTextWave(X,Y:Integer; Color:Byte; Pa:Word; S:String);
-
- Works just like OutText, only this time the text will be
- written along the line defined by the last call to SetWave. No
- clipping is performed on the Y-axis and the TextSize-setting
- will be ignored. Instead, the output will always be sized at
- 100%, the default textsize.
-
-
- PackData (Function) TGK_FILE
- ──────────────────────────────────────────────────────────────
- PackData(Var DataIn,DataOut;
- NrIn:Word; Var NrOut:Word) : Boolean;
-
- Will apply Run-Length (RLE) compression on the data pointed to
- by [DataIn] for [NrIn] bytes. The resulting (compressed) data
- will be stored in [DataOut] and the size of this block will be
- returned in [NrOut]. It's good practise to allocate at least
- the same amount of memory for [DataOut] as [DataIn] needed and
- to initialize [NrOut] with the same value [NrIn] has upon
- calling this procedure. Returns false if the data could not be
- compressed, otherwise true. Works best on simple bitmap data
- and the like, not at all on say an executable file.
-
-
- PageOffset and PageSegment (Const) TGK_MAIN
- ──────────────────────────────────────────────────────────────
-
- These are two arrays of constants defining the starting ad-
- dresses of each page in videomemory. The PageOffset array
- contains the offset addresses as relative to segment $A000 and
- the PageSegment array contains the absolute segment addresses
- of each page.
-
-
- Paint (Procedure) TGK_GP
- ──────────────────────────────────────────────────────────────
- Paint(X,Y:Integer; Color:Byte; Pa:Word);
-
- Will do a floodfill starting at (X,Y) on page [Pa], using
- [Color] as the fill-color. Will fill up to any color different
- than the one originally found at (X,Y). Clips to the viewport.
-
-
- PaintTo (Procedure) TGK_GP
- ──────────────────────────────────────────────────────────────
- PaintTo(X,Y:Integer; Color,BackColor:Byte; Pa:Word);
-
- Will do a floodfill starting at (X,Y) on page [Pa], using
- [Color] as the fill-color. Will fill up to [BackColor]. Clips
- to the viewport.
-
-
- PaletteType (Type) TGK_MAIN
- ──────────────────────────────────────────────────────────────
- PaletteType = Array[0..255] of RGBEntry;
-
- A type used to store a complete VGA-palette. Used in combina-
- tion with SetPalette and GetPalette.
-
-
- PalUpdates (Type) TGK_FILE
- ──────────────────────────────────────────────────────────────
- PalUpdates = (None,Replace,Remap);
-
- A type used by the procedure SetPalUpdate to specify one of
- three possible palette-update types. For more information on
- palette-remapping and -updating, have a look at SetPalUpDate.
-
-
- PathType (Type) TGK_ANIM
- ──────────────────────────────────────────────────────────────
- PathType = Record
- Path : Pointer;
- NrPoints : Word;
- CurPoint : Word;
- End;
-
- This type is used to store animation-paths. Animation paths
- can be used to have an animation move along a certain "path"
- which cannot be easily defined through the use of a mathema-
- tical equation. In these cases it's often easier to store the
- path as a number of coordinates, each reflecting a (relative)
- position on screen. [Path] contains a pointer the the actual
- data, [NrPoints] reflects the number of coordinates in this
- path. [CurPoint] is the currently active point and is only
- used by HandleAnimation as sort of a bookmarker.
- Feature versions of G∙A∙M∙E will include a path-editor, allo-
- wing you to create these path-files by simply defining on
- screen what your path will look like and then saving this data
- to disk but as for now you don't really have much use for it.
-
-
- PauseMusic (Procedure) TGK_SND
- ──────────────────────────────────────────────────────────────
-
- Pauses the currently playing FM-Music, if any. May be unpaused
- through a call to StartMusic (with the same piece'o'music as a
- parameter, as was playing before the pause).
-
-
- PixelInSprite (Function) TGK_BM
- ──────────────────────────────────────────────────────────────
- PixelInSprite(X,Y:Word; Sprite:SpriteType) : Boolean;
-
- Return true if the pixel at position (X,Y) is set in [Sprite],
- whereas "set" means this pixel contains a value other than 0
- (which is probably black) or "translucent".
-
-
- Poly (Procedure) TGK_GP
- ──────────────────────────────────────────────────────────────
- Poly(NrPoints:Integer; Var Points; Color:Byte; Pa:Word);
-
- Draws a polygon using color [Color] on page [Pa], while clip-
- ping to the current viewport. [NrPoints] specifies the number
- of coordinate-pairs in the polygon and [Points] is an untyped
- variable containing an array of (X,Y) coordinate-pairs. Let me
- demonstrate how all this works:
-
- Const Form : Array[1..3,1..2] of Integer =
- ((100,100),
- (150,120),
- (110,160));
-
- Poly(3,Form,10,0);
-
- This will draw a (triangular) polygon on page 0, using color
- 10 and the three coordinates as specified in the array [Form].
-
-
- PutBlock (Procedure) TGK_BM
- ──────────────────────────────────────────────────────────────
- PutBlock(X1,Y1:Integer; Sprite:SpriteType; Pa:Word);
-
- Displays the contents of sprite [Sprite] on page [Pa] on the
- coordinates ([X1],[Y1]). A value of zero in the spritedata
- will NOT be treated as transparent. Thus, all pixels will be
- displayed. This is somewhat faster than PutImage but can only
- be used on backgrounds with one single color or otherwise
- things will look pretty messed up. [Pa] should be in the range
- [0..3]. The sprite will be clipped to the current viewport.
-
-
- PutImage (Procedure) TGK_BM
- ──────────────────────────────────────────────────────────────
- PutImage(X1,Y1:Integer; Sprite:SpriteType; Pa:Word);
-
- Displays the contents of sprite [Sprite] on page [Pa] on the
- coordinates ([X1],[Y1]). A value of zero in the spritedata
- will be treated as transparent and thus not be displayed. [Pa]
- should be in the range [0..3]. The sprite will be clipped to
- the current viewport.
-
-
- PutImageAdd (Procedure) TGK_BM
- ──────────────────────────────────────────────────────────────
- PutImageAdd(X1,Y1:Integer; Sprite:SpriteType; Pa:Word);
-
- Works exactly the same as PutImage, only now if a pixel in the
- spritedata is set, it's value will be added to that of the
- corresponding pixel on screen. This mode is used in a lot of
- demonstration programs to create an effect called "shading
- bobs". Don't ask me why they've chosen this name, but hey, it
- sure looks nice... 8^)
-
-
- PutImageBrighter (Procedure) TGK_BM
- ──────────────────────────────────────────────────────────────
- PutImageBrighter(X1,Y1:Integer; Sprite:SpriteType; Pa:Word);
-
- Works exactly the same as PutImage, only now if a pixel in the
- spritedata is set, the corresponding pixel on screen will be
- set to a brighter value, thus creating the effect of a light-
- bundle reflecting on the screen.
- Hint: You could create a sprite formed like a circle and have
- it moving over the screen as sort of a spotlight. Looks
- pretty nice, especially when using multiple calls to
- PutImageBrighter on the same position on screen.
-
-
- PutImageDimmer (Procedure) TGK_BM
- ──────────────────────────────────────────────────────────────
- PutImageDimmer(X1,Y1:Integer; Sprite:SpriteType; Pa:Word);
-
- Works exactly the same as PutImage, only now if a pixel in the
- spritedata is set, the corresponding pixel on screen will be
- set to a dimmer value, thus creating the effect of a shadow.
-
-
- PutImageM (Procedure) TGK_BM
- ──────────────────────────────────────────────────────────────
- PutImageM(X1,Y1:Integer; Sprite:SpriteType; Pa:Word);
-
- Puts the image [Sprite] on page [Pa] at the coordinates
- ([X1],[Y1]), using the mask defined on page 3, the mask page.
- For more info on how this works, have a look at SpriteType and
- PutImageSc.
-
-
- PutImageSc (Procedure) TGK_BM
- ──────────────────────────────────────────────────────────────
- PutImageSc(X1,Y1:Integer; Color:Byte;
- Sprite:SpriteType; Pa:Word);
-
- Works exactly the same as PutImage, only this time, all pixels
- in the spritedata that are set, will be displayed on screen in
- color [Color]. This works pretty well in conjunction with the
- mask page for PutImageM and PutRotatedM. Suppose you've drawn
- this (absolutely wonderful) picture of a tree and from now on
- you'd like all your characters to move "behind" that tree
- because, hey, that (absolutely wonderful) tree must be dis-
- played at all times, no matter what... So what you do is that
- you use PutImageSc to put your image on page 3, the mask page,
- using a value of 4 for [Color] and after that you set the ZPos
- variable for your characters to 5 and use PutImageM to display
- them. Voila, they move behind that tree of yours...
-
-
- PutPixel (Procedure) TGK_GP
- ──────────────────────────────────────────────────────────────
- PutPixel(X,Y:Integer; Color:Byte; Pa:Word);
-
- Displays a pixel at coordinates (X,Y) in using color [Color]
- on page [Pa]. Clips to the current viewport.
-
-
- PutRotated (Procedure) TGK_BM
- ──────────────────────────────────────────────────────────────
- PutRotated(X,Y,MoveX,MoveY:Integer; Angle:Word;
- Sprite:SpriteType; Pa:Word);
-
- Displays the contents of sprite [Sprite] on page [Pa], rotated
- at an angle specified by [Angle]. The Coordinates (X,Y) denote
- the top-left corner of the image. [MoveX] and [MoveY] specify
- the number of pixels the image should be moved from the center
- for respectively the X- and Y-axis. A value of zero in the
- spritedata will be treated as transparent and thus not be
- displayed. [Pa] should be in the range [0..3]. The sprite will
- NOT be clipped to the current viewport so take care when
- putting images on screen this way, as they will wrap-around
- the edges of the screen.
-
-
- PutScaled (Procedure) TGK_BM
- ──────────────────────────────────────────────────────────────
- PutScaled(X1,Y1:Integer; Centered:Boolean; Size:Word;
- Sprite:SpriteType; Pa:Word);
-
- Displays the contents of sprite [Sprite] on page [Pa], scaled
- to the size specified by [Size], where [Size] is in percents.
- If Centered is true, the image will be centered around the
- (X1,Y1) coordinates, otherwise these coordinates denote the
- top-left corner of the image, as with the normal PutImage. A
- value of zero in the spritedata will be treated as transparent
- and thus not be displayed. [Pa] should be in the range [0..3].
- The sprite will be clipped to the current viewport.
-
-
- PutScaledM (Procedure) TGK_BM
- ──────────────────────────────────────────────────────────────
- PutScaledM(X1,Y1:Integer; Centered:Boolean; Size:Word;
- Sprite:SpriteType; Pa:Word);
-
- Puts the image [Sprite] on page [Pa] at the coordinates
- (X1,Y1), using the mask defined on page 3, the mask page,
- scaled to the size specified by [Size]. The image can option-
- ally be centered around (X1,Y1) when [Centered] is set to
- true. For more info on how this works, have a look at Sprite-
- Type and PutImageSc.
-
-
- PutScaledSc (Procedure) TGK_BM
- ──────────────────────────────────────────────────────────────
- PutScaledSc(X1,Y1:Integer; Centered:Boolean; Color:Byte;
- Size:Word; Sprite:SpriteType; Pa:Word);
-
- Works exactly the same as PutScaled only now with the same
- side-effects as PutImageSc. For more info, read about PutSca-
- led and PutImageSc.
-
-
- PutWave (Procedure) TGK_BM
- ──────────────────────────────────────────────────────────────
- PutWave(X1,Y1:Integer; Sprite:SpriteType; Pa:Word);
-
- Displays the contents of sprite [Sprite] on page [Pa] on the
- coordinates (X1,Y1), using the waveform specified through a
- previous call to SetWave. A value of zero in the spritedata
- will be treated as transparent and thus not be displayed. [Pa]
- should be in the range [0..3]. The sprite will be clipped to
- the current viewport.
-
-
- PutWaveSC (Procedure) TGK_BM
- ──────────────────────────────────────────────────────────────
- PutWaveSC(X1,Y1:Integer; Sprite:SpriteType; Pa:Word);
-
- Works exactly the same as the PutImageSC procedure, only this
- time the waveform specified through a previous call to SetWave
- will be used.
-
-
- QuestionWindow (Function) TGK_WIN
- ──────────────────────────────────────────────────────────────
- QuestionWindow(X,Y,Pa:Word; Question:String) : Boolean;
-
- Pops up a question-window (Yes/No) at (X,Y) on page [Pa]. The
- question you want to ask the user must be in [Question]. The
- result is returned as a boolean, but two constants, Yes and No
- have been defined to program something like this:
-
- If QuestionWindow(20,20,0,'Do you like Femke?')=Yes
- then MessageWindow(50,50,0,'Great, so do I...')
- else MessageWindow(50,50,0,'Get A Life!');
-
- Hint: You answer should have been YES!
-
-
- Raster (Variable) TGK_MAIN
- ──────────────────────────────────────────────────────────────
- Raster = Array[1..20] of RasterType;
-
- This array holds the twenty available raster-definitions. Do
- not alter it directly but only through the use of SetUserRas-
- ter. For an example on how this is done, have a look at the
- RasterType description.
-
-
- RasterType (Type) TGK_MAIN
- ──────────────────────────────────────────────────────────────
- RasterType = Array[0..31] of Byte;
-
- This type is used to store a single raster-description. Used
- in combination with SetUserRaster to set one of the twenty
- available user-rasters. A raster is merely an array of colors
- describing what the raster will look like once used as a
- fillstyle. Thus, to create a raster sliding from lightred to
- darkred and back, one could use code like this:
-
- Var MyRaster : RasterType;
- A : Byte;
-
- For A:=0 to 15 do
- Begin
- MyRaster[A]:=32+A;
- MyRaster[31-A]:=32+A;
- End;
- SetUserRaster(1,MyRaster);
-
-
- ReadKey (Function) TGK_IO
- ──────────────────────────────────────────────────────────────
- ReadKey : Char;
-
- Reads a key from the keyboard buffer or, if no key is availa-
- ble, waits until the user presses a key.
-
-
- Rectangle (Procedure) TGK_GP
- ──────────────────────────────────────────────────────────────
- Rectangle(X1,Y1,X2,Y2:Integer; Color:Byte; Pa:Word);
-
- Draws a rectangle on page [Pa], using color [Color]. The
- coordinate-pair (X1,Y1) denotes the upperleft corner of the
- rectangle, whereas (X2,Y2) denotes the lowerright corner.
- Clips to the current viewport.
-
-
- Resource (Variable) TGK_FILE
- ──────────────────────────────────────────────────────────────
- Resource : String;
-
- By default this string will be empty. If the programmer chan-
- ges it, however, all file-handling routines will search for
- their files in the resource-file specified by this string. If
- a certain file is not found in the resource, the file-handling
- rountines will continue looking for it as a stand-alone file.
- For more information on how resources work, have a look at the
- description of the MAKERES program, as discussed in chapter 4,
- paragraph 4.5.
-
-
- RestoreFillStyle (Procedure) TGK_GP
- ──────────────────────────────────────────────────────────────
- RestoreFillStyle(Style:Byte);
-
- Restores a previously saved FillStyle from [Style].
-
-
- RGBEntry (Type) TGK_MAIN
- ──────────────────────────────────────────────────────────────
- RGBEntry = Record
- R,G,B : Byte;
- End;
-
- This type is used to define one entry in a PaletteType, with
- the R,G and B entries specifying the red, green and blue
- components.
-
-
- RightButton (Function) TGK_IO
- ──────────────────────────────────────────────────────────────
- RightButton : Boolean;
-
- Returns true if the right mousebutton is currently down.
-
-
- RightText (Const) TGK_TEXT
- ──────────────────────────────────────────────────────────────
- RightText = 2;
-
- Used in conjunction with SetTextJustify, for more information
- on how this procedure works, have a look under the appropriate
- header.
-
-
- RotateObject (Procedure) TGK_3D
- ──────────────────────────────────────────────────────────────
- RotateObject(Nr:Word; RX,RY,RZ:Integer);
-
- Rotates vector-object [Nr] for [RX], [RY] and [RZ] degrees
- along the respective axes.
-
-
- RShiftPressed (Function) TGK_IO
- ──────────────────────────────────────────────────────────────
- RShiftPressed : Boolean;
-
- Returns true if the Right Shift-Key is currently being pres-
- sed.
-
-
- SampleType (Type) TGK_SND
- ──────────────────────────────────────────────────────────────
- SampleType = Record
- SampleStopped : Boolean;
- { Plus lots of uninteresting stuff...}
- End;
-
- This type is used by the various digital-sound-playback routi-
- nes found in TGK_SND. The only interesting field is [Sample-
- Stopped], which can be used to check whether a sample is
- currently playing or not. This may come in handy if you want
- to start a new sample right after the old one has stopped.
-
-
- SaveFillStyle (Procedure) TGK_GP
- ──────────────────────────────────────────────────────────────
- SaveFillStyle(Var Style:Byte);
-
- Saves the current fillstyle in [Style].
-
-
- SaveGPF (Procedure) TGK_FILE
- ──────────────────────────────────────────────────────────────
- SaveGPF(FileName:String; Pa:Word);
-
- Will save a GPF (G∙A∙M∙E-Picture File) file to disk. Storing
- the contents of page [Pa] in a file named [FileName]. If no
- extension is specified, the default extension, .GPF will be
- used.
-
-
- SaveImage (Procedure) TGK_FILE
- ──────────────────────────────────────────────────────────────
- SaveImage(FileName:String; Sprite:SpriteType);
-
- Saves the contents of the sprite [Sprite] to a file named
- [FileName]. [Sprite] must have been previously initialized and
- preferably contain useful data ;-) If no extension is speci-
- fied, the default extension, .GSF will be used.
-
-
- SBInstalled (Const) TGK_SND
- ──────────────────────────────────────────────────────────────
- SBInstalled : Boolean;
-
- [SBInstalled] will be set to true if a Soundblaster-Compatible
- soundcard was found in your system. Otherwise, it will be set
- to false.
-
-
- ScrollPage TGK_GP
- ──────────────────────────────────────────────────────────────
- ScrollPage(Page:Byte; Dir:Direction; Pixels,Color:Byte);
-
- Scrolls page [Page] in the direction specified by [Dir]. The
- number of pixels to be scrolled is specified by [Pixels] and
- the color to use to fill the part that scrolls in by [Color].
- [Dir] is of type Direction. For more info in this type, look
- under the appropriate header.
-
-
- SetBlackPal (Procedure) TGK_MAIN
- ──────────────────────────────────────────────────────────────
-
- This procedure will set the entire palette to black.
-
-
- SetColor (Procedure) TGK_MAIN
- ──────────────────────────────────────────────────────────────
- SetColor(Nr:Byte; Entry:RGBEntry);
-
- Sets the red, green and blue values for entry [Nr] of the
- palette. For example, to set color number 10 to deep purple,
- one could use code similar to:
-
- Var MyEntry : RGBEntry;
-
- With MyEntry do
- Begin
- R:=63;
- G:=0;
- B:=63;
- End;
- SetColor(10,MyEntry);
-
-
- SetColorPal (Procedure) TGK_MAIN
- ──────────────────────────────────────────────────────────────
- SetColorPal(Color:Byte);
-
- This procedure will set the entire palette to the color speci-
- fied in [Color]. [Color], however, is one of the 256 palette
- entries and thus a variable value. If you would like to be
- sure you will set the entire palette to blue, use some code
- like this:
-
- Var Entry : RGBEntry;
-
- With Entry do
- Begin
- R:=0;
- G:=0;
- B:=63;
- End;
- SetColor(1,Entry);
- SetColorPal(1);
-
-
- SetDACDevice (Procedure) TGK_SND
- ──────────────────────────────────────────────────────────────
- SetDACDevice(Device:SoundDevice);
-
- Sets the active digital-sound playback-device to [Device],
- which must be one of the these:
-
- · Speaker
- · Adlib
- · SoundBlaster
- · Covox
-
- Adlib and SoundBlaster will only work if the appropriate
- hardware is installed in your computer. A Covox device cannot
- be detected and should be handled with care. The port-number
- for a covox device can be specified using SetDACPort.
-
-
- SetDACPort (Procedure) TGK_SND
- ──────────────────────────────────────────────────────────────
- SetDACPort(PortNr:Word);
-
- Sets the port number to use for Covox digital-sound playback
- to [PortNr]. By default it is set to $300, the base address
- for a prototype expansion-card. If [PortNr] is in the range
- 1..4, the address will be set to that of the corresponding
- printerport (LPT1..LPT4) as found in the BIOS data-area,
- otherwise, the absolute number specified will be used.
-
-
- SetDefaultWindowColors (Procedure) TGK_WIN
- ──────────────────────────────────────────────────────────────
-
- Sets the default color selection for the windows.
-
-
- SetFillStyle (Procedure) TGK_GP
- ──────────────────────────────────────────────────────────────
- SetFillStyle(Style:Byte);
-
- Sets the current fillstyle. [Style] can be one of these:
-
- 0 · Standard Single-Color/Solid
- 1..20 · Horizontal Raster
- 21..40 · Vertical Raster
- 41..44 · Patterned/Translucent
- 45..60 · User defined patterns (16x16)
- 61 · Brighter
- 62 · Dimmer
- 63 · Xor
- 64 · Zero
-
- The Horizontal and Vertical raster-fills can be changed using
- the SetUserRaster procedure. The Patterned/Translucent fills
- can be changed using the SetUserMask procedure. Finally, The
- User defined patterns can be changed using the SetUserFill
- procedure. Just try all of the different fillstyles to get an
- idea on how they work.
-
-
- SetFont (Procedure) TGK_TEXT
- ──────────────────────────────────────────────────────────────
- SetFont(Nr:Byte);
-
- Sets the active font to the one specified in [Nr]. [Nr] must
- be in the range 0..5, where 0 reflects the internal font and
- 1..5 any of the user-loadable fonts. If no font has been
- previously loaded into the slot specified, SetFont won't do
- anything and the current font remains the active one.
-
-
- SetInstrument (Procedure) TGK_SND
- ──────────────────────────────────────────────────────────────
- SetInstrument(Voice:Byte; Var Ins);
-
- Sets the instrument for voice number [Voice] to [Ins]. [Ins]
- must be an array of 12 bytes containing the instrument data.
- The format used here is the same as in the standard SoundBlas-
- ter-instrument-files, the [.SBI]-files. For more information
- on this format please consult some document or maybe a book on
- SoundBlaster programming.
-
-
- SetMode (Procedure) TGK_SND
- ──────────────────────────────────────────────────────────────
- SetMode(Mode:ModeType);
-
- Sets the mode of an Adlib- or a SoundBlaster-card to either
- Melodic or Percussive. In Melodic mode, these cards are capa-
- ble of playing music in 9 melodic voices. In the Percussive
- mode, there are 6 melodic voices and 5 percussive voices. You
- must really know quite a lot about these cards to completely
- understand what this procedure does; If you don't -- just
- don't use the procedure, you'll manage fine without it 8-)
-
-
- SetMouse (Procedure) TGK_IO
- ──────────────────────────────────────────────────────────────
- SetMouse(X,Y:Integer);
-
- Sets the mousecursor to the position specified by the [X] and
- [Y] variables. Clips to the mouse-boundaries.
-
-
- SetMouseCursor (Procedure) TGK_IO
- ──────────────────────────────────────────────────────────────
- SetMouseCursor(Shape:MouseStruct);
-
- Sets the mousecursor to the shape defined in [Shape]. [Shape]
- if of type MouseStruct. For a more detailed description of
- this type, have a look at MouseStruct.
-
-
- SetMouseRange (Procedure) TGK_IO
- ──────────────────────────────────────────────────────────────
- SetMouseRange(X1,Y1,X2,Y2:Word);
-
- Sets the mouse-boundaries to the rectangular area specified by
- [X1], [Y1], [X2] and [Y2]. Clips to the screen boundaries.
-
-
- SetMouseSensivity (Procedure) TGK_IO
- ──────────────────────────────────────────────────────────────
- SetMouseSensivity(Hr,Vr:Integer);
-
- Mouse-sensivity is the number of pixels the mousecursor will
- move in relation to the actual mouse-movement. [Hr] specifies
- the horizontal ratio and [Vr] the vertical ratio. The higher
- the value, the more the cursor will move in relation to your
- mouse-movements.
-
-
- SetMouseSettings (Procedure) TGK_IO
- ──────────────────────────────────────────────────────────────
- SetMouseSettings(MouseInfo:MouseSettingsType);
-
- Restores the mousesettings from a previously saved [MousInfo]
- record. For a more detailed description of the [MouseInfo]
- record have a look at MouseSettingsType.
-
-
- SetMusicDevice (Procedure) TGK_SND
- ──────────────────────────────────────────────────────────────
- SetMusicDevice(Device:SoundDevice);
-
- Sets the active FM-Music playback-device to [Device], which
- must be one of the these:
-
- · Speaker
- · Adlib
- · SoundBlaster
-
- Adlib and SoundBlaster will only work if the appropriate
- hardware is installed in your computer. When MusicDevice is
- set to Speaker, music playback may sound weird at times ;-)
-
-
- SetOrigin (Procedure) TGK_3D
- ──────────────────────────────────────────────────────────────
- SetOrigin(Nr:Word; X,Y:Integer);
-
- Sets the position on screen for vector-object [Nr] to (X,Y).
-
-
- SetOverallVolume (Procedure) TGK_SND
- ──────────────────────────────────────────────────────────────
- SetOverallVolume(Vol:Real);
-
- Sets the overall volume of the Adlib- and Soundblaster-cards
- for the playback of FM-Music to [Vol]. [Vol] must be in the
- range 0.0..1.0 with 1.0 being the loudest.
-
- Hint: Nice for fading effects on music and sound-effects!
-
-
- SetPage (Procedure) TGK_MAIN
- ──────────────────────────────────────────────────────────────
- SetPage(Pa:Word);
-
- This procedure sets the active display page. The parameter
- [Pa] should be in the range [0..3].
-
-
- SetPalette (Procedure) TGK_MAIN
- ──────────────────────────────────────────────────────────────
- SetPalette(Var Palette);
-
- Uses the structure in [Palette] to set the current palette.
- [Palette] being an untyped variable, we can actually use any
- structure as a palette. However, it is good practice to use
- the G∙A∙M∙E PaletteType.
-
-
- SetPalUpdate (Procedure) TGK_FILE
- ──────────────────────────────────────────────────────────────
- SetPalUpdate(UpDate:PalUpdates);
-
- Changes the palette-updating/remapping method used when loa-
- ding images from disk to one of the following:
-
- · None The palette will never be updated when
- loading images from disk. This is the
- default setting. As a result, images may
- appear in the wrong colors.
-
- · Replace Palette information will be loaded from
- the image and the new palette will be
- set. Images will always appear correctly
- but other information on screen might
- appear in the wrong colors.
-
- · Remap The colors used in the image will be
- remapped to appear close to those used
- in the current palette. Images may look
- like they've been sanbathing too long or
- maybe like they didn't sleep that well,
- but at least, the old palette info is
- retained.
-
- Each of these methods has it's benefits. [None] is fast,
- [Replace] accurate and [Remap] may be a good alternative...
-
-
- SetProportional (Procedure) TGK_TEXT
- ──────────────────────────────────────────────────────────────
- SetProportional(Proportional:Boolean);
-
- When set to true, characters in a printed string occupy an
- amount of space relative to their horizontal size. Otherwise,
- all characters occupy an equal number of pixels, regardless of
- their actual width.
-
-
- SetSampleSpeed (Procedure) TGK_SND
- ──────────────────────────────────────────────────────────────
- SetSampleSpeed(Speed:Word);
-
- Sets the playback-speed for digital-sounds in [Speed] bytes
- per second. The default setting is 10000. Some sample require
- different speeds, however. It is also possible to change the
- pitch of a sample by varying the playback-speed. This way,
- some pretty neat effects can be achieved.
-
-
- SetSpacing (Procedure) TGK_TEXT
- ──────────────────────────────────────────────────────────────
- SetSpacing(Space:Byte);
-
- [Space] reflects the number of blank pixels G∙A∙M∙E will add
- in between each printed character. The default setting is 2,
- however for some larger fonts, a setting of 3 or 4 may be more
- appropriate.
-
-
- SetSpecialRange (Procedure) TGK_IO
- ──────────────────────────────────────────────────────────────
- SetSpecialRange(X1,Y1,X2,Y2:Integer);
-
- Sets the rectangular area in which the mousecursor will NOT be
- visible to the coordinates specified by [X1], [Y1], [X2] and
- [Y2]. Will clip to the screen boundaries.
-
-
- SetTextJustify (Procedure) TGK_TEXT
- ──────────────────────────────────────────────────────────────
- SetTextJustify(Horizontal,Vertical:Byte);
-
- Sets the horizontal and vertical text justification. For the
- [Horizontal] parameter, the values LeftText, CenterText and
- RightText are possible, for the [Vertical] parameter, one can
- use BottomText, CenterText and TopText. Using the following
- diagram, I will show you how each of these parameters affects
- the way in which text is being displayed:
-
-
- Horizontal:
-
- left center right
- Vertical:
- │LOT LOT LOT│
- ──┼──────┼──────┼── bottom
- │ │ │
- ──┼LOT──LOT──LOT┼── center
- │ │ │
- ──┼──────┼──────┼── top
- │LOT LOT LOT│
-
-
- SetTextMode (Procedure) TGK_TEXT
- ──────────────────────────────────────────────────────────────
- SetTextMode(Mode:TextModeType);
-
- Sets the textmode to either Speed or Precision. When [Mode] is
- set to Speed, integer math will be used when calculating text-
- positions on screen. When set to Precision, real math will be
- used, giving better results but being somewhat slower.
-
-
- SetTextSettings (Procedure) TGK_TEXT
- ──────────────────────────────────────────────────────────────
- SetTextSettings(Settings:TextSettingsType);
-
- Restores previously saved textsettings. For more information
- on which textsettings are affected, please have a look at the
- GetTextSettings procedure, as discussed under it's header.
-
-
- SetTextSize (Procedure) TGK_TEXT
- ──────────────────────────────────────────────────────────────
- SetTextSize(Size:Word);
-
- Sets the textsize to [Size] percents. Thus, all values within
- the range 1..99 will produce characters smaller than the
- normal size, 100 is the normal size and any value greater than
- 100 will produce larger characters than normal.
-
-
- SetupAnimation (Procedure) TGK_ANIM
- ──────────────────────────────────────────────────────────────
- SetupAnimation(Var Animation:AnimType;
- X,Y:Integer; Mode:AnimMode);
-
- Sets the animation specified in [Animation] to the (X,Y)-
- position on screen denoted to by [X] and [Y], and sets it's
- animation-mode to [Mode]. For a complete description of all
- animation-modes, have a look at AnimMode.
-
-
- SetUserFill (Procedure) TGK_GP
- ──────────────────────────────────────────────────────────────
- SetUserFill(Nr:Byte; Var FillData);
-
- Sets the user-fillstyle [Nr]. [Nr] must be in the range 1..16,
- corresponding to the fillstyles 45..60 as discussed under
- SetFillStyle. [FillData] is a 16x16 array, containing the
- bitmap-info. This is discussed in greater detail under the
- header FillPatType.
-
-
- SetUserMask (Procedure) TGK_GP
- ──────────────────────────────────────────────────────────────
- SetUserMask(Nr,OddMask,EvenMask:Byte);
-
- Sets the user-definable patternfill [Nr]. [Nr] must be in the
- range 1..4, corresponding to the fillstyles 41..44 as discus-
- sed under SetFillStyle. [OddMask] and [EvenMask] must both be
- in the range 0..15 and should be regarded as a binary number
- specifying what the pattern will look like on screen for the
- odd and even lines respectively. For example if [OddMask] is
- given a value of 5 (0101) and [EvenMask] a value of 10 (1010),
- the resulting pattern on screen will look like this:
-
- Line 0 101010101010
- Line 1 010101010101
- Line 2 101010101010 Etc.
-
- Zero-bits will be translucent.
-
-
- SetUserRaster (Procedure) TGK_GP
- ──────────────────────────────────────────────────────────────
- SetUserRaster(Nr:Byte; Var RasterData);
-
- Sets the raster colors for raster number [Nr]. [Nr] must be in
- the range [1..20], corresponding to the fillstyle 1..20 and
- 21..40 as discussed under SetFillStyle. [RasterData] is of
- type RasterType and contains an array of 32 color-values,
- specifying the color number to use for each rasterline. Just
- fiddle around with this to see how it works...
-
-
- SetViewPort (Procedure) TGK_MAIN
- ──────────────────────────────────────────────────────────────
- SetViewPort(X1,Y1,X2,Y2:Integer);
-
- SetViewPort specifies the rectangular area on screen to which
- all output will be redirected to the one specified by the
- coordinate-pairs (X1,Y1)-(X2,Y2).
-
-
- SetVolume (Procedure) TGK_SND
- ──────────────────────────────────────────────────────────────
- SetVolume(Voice:Byte; Vol:Real);
-
- Sets the relative volume of voice [Voice] on the Adlib-
- and Soundblaster-cards to [Vol], which must be in the range
- 0.0..1.0 with 1.0 being the loudest.
-
- Hint: Nice for fading effects on music and sound-effects!
-
-
- SetWave (Procedure) TGK_BM
- ──────────────────────────────────────────────────────────────
- SetWave(Wave:WaveType);
-
- This procedure is used to specify a list of (what I call) "Y-
- Offset-Values" for the procedures PutWave, PutWaveSC and
- OutTextWave. [Wave] contains the Y-Offset for each of the 320
- columns on screen. By filling [Wave] using a sine-function or
- so, one can really create "fuzzy" effects. Here's a nice one:
-
- Var MyWave : WaveType;
- A : Word;
-
- For A:=0 to 319 do
- MyWave[A]:=Round(Sin(A/(Pi*4.05))*20);
- SetWave(MyWave);
-
-
- SetWhitePal (Procedure) TGK_MAIN
- ──────────────────────────────────────────────────────────────
-
- This procedure will set the entire palette to white.
-
-
- SetWindowColors (Procedure) TGK_WIN
- ──────────────────────────────────────────────────────────────
- SetWindowColors(ColorSet:WindowColorSet);
-
- Sets the color selection for the windows. For a more detailed
- explanation, look under WindowColorSet.
-
-
- ShiftPressed (Function) TGK_IO
- ──────────────────────────────────────────────────────────────
- ShiftPressed : Boolean;
-
- Returns true if either of the two Shift-Keys is currently
- being pressed.
-
-
- ShowPage (Procedure) TGK_MAIN
- ──────────────────────────────────────────────────────────────
- ShowPage(Pa:Word);
-
- A call to ShowPage will copy the contents of page [Pa] to the
- active display page. [Pa] should be in the range [0..3].
-
-
- SizeObject (Procedure) TGK_3D
- ──────────────────────────────────────────────────────────────
- SizeObject(Nr:Word; R:Real);
-
- Multiplies all of the points in vector-object [Nr] by [R].
- Thus a value of 0.5 for [R] will cause the object to become
- twice as small.
-
-
- SlideButtonResult (Function) TGK_WIN
- ──────────────────────────────────────────────────────────────
- SlideButtonResult(Window:WindowType; Nr:Word) : Word;
-
- Returns the current value for button number [Nr] on window
- [Window], a button of type slidebutton. For a programming
- example, look under CheckButtonResult.
-
-
- SoundDevice (Type) TGK_SND
- ──────────────────────────────────────────────────────────────
- SoundDevice = (Speaker,Adlib,SoundBlaster,Covox);
-
- This type is used by the procedures SetMusicDevice and SetDAC-
- Device to specify the type of sound-device to use. Also, the
- constants MusicDevice and DACDevice use this type to reflect
- the current devices for music- and digital-sound-playback.
-
-
- Spline (Procedure) TGK_GP
- ──────────────────────────────────────────────────────────────
- Spline(NrPoints:Word; Var CurveData; Color:Byte; Pa:Word);
-
- Will draw the most flowing line between the number coordinates
- specified by [NrPoints] on page [Pa], using [Color] as the
- drawing-color. [CurveData] contains an array of (X,Y)-coordi-
- nate pairs. The principle here is the same as used in Poly and
- FPoly. For more info on how these arrays containing coordinate
- pairs work, have a look over there.
-
-
- SpriteHeight (Function) TGK_BM
- ──────────────────────────────────────────────────────────────
- SpriteHeight(Sprite:SpriteType; Size:Word):Word;
-
- Returns the height of sprite [Sprite] in pixels for the size
- specified in [Size], where [Size] is in percents. Could, for
- example, be used to center sprites on screen on the Y-Axis.
-
-
- SpriteType (Type) TGK_BM
- ──────────────────────────────────────────────────────────────
- SpriteType = Record
- Sprite : Pointer;
- Size : Word;
- ZPos : Byte;
- End;
-
- This is a type used to denote any sprite you use in your
- programs. [Sprite] contains the actual data, or Nil if no data
- has been assigned. [Size] is the size of [Sprite] in bytes or
- zero if no data had been assigned. [ZPos] is the "z-position"
- of the sprite on screen. This variable is used in combination
- with the PutImageM and PutScaledM procedures to specify on
- which level the sprite will be drawn. There are 256 levels in
- total. If, for example, [ZPos]=10 for a certain sprite and
- PutImageM is called, the sprite will only be visible for those
- parts of the mask page smaller than or equal to 10. The mask
- page is always page 3. If you would draw a filled rectangle on
- page 3 like this: FRectangle(160,0,319,199,2,3), then the
- sprite would only be visible on the left half of the screen
- for [ZPos]<2. Thus, you could create a complete mask for any
- picture you may have on your visible page, allowing an object
- to move "behind" certain parts of that picture and "in front"
- of other parts.
-
-
- SpriteWidth (Function) TGK_BM
- ──────────────────────────────────────────────────────────────
- SpriteWidth(Sprite:SpriteType; Size:Word):Word;
-
- Returns the width of sprite [Sprite] in pixels for the size
- specified in [Size], where [Size] is in percents. Could, for
- example, be used to center sprites on screen on the X-Axis.
-
-
- Square (Procedure) TGK_GP
- ──────────────────────────────────────────────────────────────
- Square(X1,Y1,Size:Integer; Color:Byte; Pa:Word);
-
- Draws a square on page [Pa], using color [Color]. The coordi-
- nate-pair (X1,Y1) denotes the upperleft corner of the square,
- whereas (X1+Size,Y1+Size) denotes the lowerright corner. Clips
- to the current viewport.
-
-
- Standard_Palette (Const) TGK_MAIN
- ──────────────────────────────────────────────────────────────
-
- This is actually a procedure, but should NEVER be called. It's
- merely defined as a procedure to allow it to be placed in the
- code-segment. Contains a table with default color values. Set
- as the default palette by G∙A∙M∙E upon startup.
-
-
- StartMusic (Procedure) TGK_SND
- ──────────────────────────────────────────────────────────────
- StartMusic (Var MusicData:MusicType; Times:Byte);
-
- Starts playback of the musical-score stored in [MusicData], if
- any, that is, through the active MusicDevice. You've guessed
- it already; [Times] specifies the number of times to repeat
- the music. When set to zero, however, the music will continue
- playing forever (and ever -- you stay in my heart).
-
-
- StartSample (Procedure) TGK_SND
- ──────────────────────────────────────────────────────────────
- StartSample (Var Sample:SampleType; Times:Byte);
-
- Starts playback of the digital-sound stored in [Sample], if
- any, that is, through the active DACDevice. You've guessed it
- already; [Times] specifies the number of times to repeat the
- sample. When set to zero, however, the sample will continue
- playing forever (and I will love you forever -- and ever).
-
-
- StartTimer (Procedure) TGK_SND
- ──────────────────────────────────────────────────────────────
- StartTimer(TimerNr:Byte);
-
- Starts the timer specified in [TimerNr], which must be in the
- range 1..5. The timer will be reset to 0 and then start coun-
- ting up at a speed of 128 ticks/second (or 7.8125 ms/tick).
-
-
- StopMusic (Procedure) TGK_SND
- ──────────────────────────────────────────────────────────────
-
- Stops the currently playing FM-Music, if any.
-
-
- StopSample (Procedure) TGK_SND
- ──────────────────────────────────────────────────────────────
-
- Stops the currently playing digital-sound, if any.
-
-
- StringButtonResult (Function) TGK_WIN
- ──────────────────────────────────────────────────────────────
- StringButtonResult(Window:WindowType; Nr:Word) : String;
-
- Returns the current value for button number [Nr] on window
- [Window], a button of type stringbutton. For a programming
- example, look under CheckButtonResult.
-
-
- StringWidth (Function) TGK_TEXT
- ──────────────────────────────────────────────────────────────
- StringWidth(S:String) : Word;
-
- Returns the width of string [S] in pixels, accounting for the
- current textsize, font and spacing.
-
-
- StringWindow (Function) TGK_WIN
- ──────────────────────────────────────────────────────────────
- StringWindow(X,Y,XSize,Pa:Word;
- Title,StartStr:String) : String;
-
- Pops up a window at (X,Y) on page [Pa], sized at [XSize]
- pixels horizontally, entitled [Title]. [StartStr] contains the
- string to start with and the function-result returned will be
- the new string.
-
-
- SwapByte (Procedure) TGK_MAIN
- ──────────────────────────────────────────────────────────────
- SwapByte(Var A,B:Byte);
-
- Exchanges the values of the byte variables [A] and [B]. Thus
- after a call to SwapByte, [A] will contain [B]'s original
- value and vice versa.
-
-
- SwapInt (Procedure) TGK_MAIN
- ──────────────────────────────────────────────────────────────
- SwapInt(Var A,B:Integer);
-
- Exchanges the values of the integer variables [A] and [B].
- Thus after a call to SwapInt, [A] will contain [B]'s original
- value and vice versa.
-
-
- SwapWord (Procedure) TGK_MAIN
- ──────────────────────────────────────────────────────────────
- SwapWord(Var A,B:Word);
-
- Exchanges the values of the word variables [A] and [B]. Thus
- after a call to SwapWord, [A] will contain [B]'s original
- value and vice versa.
-
-
- Sync (Procedure) TGK_MAIN
- ──────────────────────────────────────────────────────────────
-
- This procedure waits for a vertical retrace to occur on your
- VGA-card. During the vertical retrace you have some time to
- update the screen, without the user noticing anything of it,
- so if you call this procedure right before you swap pages
- useing the SetPage procedure, the latter will do it's job much
- more smoothly.
-
-
- TextModeType (Type) TGK_TEXT
- ──────────────────────────────────────────────────────────────
- TextModeType = (Speed, Precision);
-
- Used by SetTextMode to set either one of the text-display
- modes. For more information on how these work, have a look
- under the SetTextMode header.
-
-
- TextSettingsType (Type) TGK_TEXT
- ──────────────────────────────────────────────────────────────
- TextSettingsType = Record
- ActiveFont,Spacing : Byte;
- TextSize : Word;
- Prop : Boolean;
- HJustify,VJustify : Byte;
- TextMode : TextModeType;
- End;
-
- This record is used by GetTextSettings and SetTextSettings to
- store and retrieve important information on settings regarding
- character-spacing, the active font, justification etc.
-
-
- TimerTicks (Function) TGK_SND
- ──────────────────────────────────────────────────────────────
- TimerTicks(TimerNr:Byte):Word;
-
- Returns the number of ticks passed for timer [TimerNr] since
- the last call to StartTimer for the appropriate timer or since
- program start. [TimerNr] must be in the range 1..5. If a long
- period of time (more than about 8.5 seconds) has passed since
- the last call or since program start, the timer will have
- overflown and reset to zero. Results for timings over longer
- periods are thus inaccurate, or useless, if you like 8-)
-
-
- TopText (Const) TGK_TEXT
- ──────────────────────────────────────────────────────────────
- TopText = 2;
-
- Used in conjunction with SetTextJustify, for more information
- on how this procedure works, have a look under the appropriate
- header.
-
-
- Triangle (Procedure) TGK_GP
- ──────────────────────────────────────────────────────────────
- Triangle(Triangle:TriangleType; Pa:Word);
-
- Draws a triangle as specified in [Triangle] on page [Pa]. Will
- clip to the current viewport. For more info on how a variable
- of type TriangleType is built up, have a look under the
- TriangleType header.
-
-
- TriangleType (Type) TGK_GP
- ──────────────────────────────────────────────────────────────
- TriangleType = Record
- X,Y : Array[1..3] of Integer;
- Col : Byte;
- End;
-
- This type is used in conjunction with Triangle and FTriangle
- to define a triangular shape with. The X- and Y-arrays contain
- the coordinates for each corner of the triangle, whereas [Col]
- contains the color to be used when drawing the triangle.
-
-
- UnPackData (Function) TGK_FILE
- ──────────────────────────────────────────────────────────────
- UnPackData(Var DataIn,DataOut;
- NrIn:Word; Var NrOut:Word) : Boolean;
-
- Will decompress the data pointed to by [DataIn] for [NrIn]
- bytes. The resulting (decompressed) data will be stored in
- [DataOut] and the size of this block will be returned in
- [NrOut]. You should know in advance what the size of the
- decompressed data [NrOut] will be and allocate enough memory
- for [DataOut]. Returns false if the data could not be decom-
- pressed, otherwise true.
-
-
- UpString (Function) TGK_MAIN
- ──────────────────────────────────────────────────────────────
- UpString(Str:String):String;
-
- Converts the string [Str] to its uppercase equivalent and
- returns this new string as a function-result.
-
-
- UseMask (Variable) TGK_ANIM
- ──────────────────────────────────────────────────────────────
- UseMask : Boolean;
-
- [UseMask] specifies whether a call to HandleAnimation will use
- the mask page to display the animation or not. When [UseMask]
- is set to false HandleAnimation won't check for a mask on the
- mask page, otherwise it will. For an extensive description on
- how the mask page works, have a look at SpriteType and PutIma-
- geM (Actually, PutImageM will be called by HandleAnimation if
- UseMask is set to true).
-
-
- UserActivity (Function) TGK_IO
- ──────────────────────────────────────────────────────────────
- UserActivity : Boolean;
-
- Returns true if the user has either moved the mouse since the
- last coordinates passed by the mousedriver or if the user has
- pressed a key.
-
-
- VLine (Procedure) TGK_GP
- ──────────────────────────────────────────────────────────────
- VLine(X1,Y1,Y2:Integer; Color:Byte; Pa:Word);
-
- Draws a vertical line from (X1,Y1) to (X1,Y2) on page [Pa],
- using color [Color]. Clips to the current viewport.
-
-
- WaitTimer (Procedure) TGK_SND
- ──────────────────────────────────────────────────────────────
- WaitTimer(TimerNr:Byte; Ticks:Word; Reset:Boolean);
-
- Waits until timer number [TimerNr] has reached [Ticks] ticks
- (or [Ticks]/128 seconds). If [Reset] is set to true, the timer
- will be reset to zero after this operation.
-
-
- WaveType (Type) TGK_BM
- ──────────────────────────────────────────────────────────────
- WaveType = Array[0..319] of Integer;
-
- This type is used by the procedure Setwave. For more info,
- take a look over there.
-
-
- WDefault, WCloseable, WMoveable (Constants) TGK_WIN
- ──────────────────────────────────────────────────────────────
- WDefault = 0;
- WCloseable = 1;
- WMoveable = 2;
-
- Constants used by InitWindow to determine some aspects of
- the window. Using WDefault will cause a window not to have a
- "Close"-button, neither can it be moved.
- By adding in WCloseable and/or WMoveable, these options can
- be changed. Tâdaah! Example:
-
- Var MyWin : WindowType;
-
- InitWindow(MyWin,10,10,100,100,'Pizza Delivery');
- OpenWindow(MyWin,WCloseable+WMoveable,0);
- Repeat
- until HandleWindow(MyWin)=0;
- CloseWindow(MyWin);
-
- This piece of code will open a simple window which can be
- moved around the screen by clicking on its border. It will
- wait until the window is closed by clicking on the "Close"-
- button in the upperleft corner of the window.
-
-
- WinBut (Type) TGK_WIN
- ──────────────────────────────────────────────────────────────
-
- Internal type used by TGK_WIN, of no further interest to the
- user.
-
-
- WindowColorSet (Type) TGK_WIN
- ──────────────────────────────────────────────────────────────
- WindowColorSet = Record
- Line,BackGround,Button,
- Text,FillStyle,Bright,
- Dim,Bar,Finch,BarFill : Byte;
- End;
-
- This is a type used by GetWindowColors and SetWindowColors to
- create your personal "windowing-look". Each field in this
- record contains the color (or fill) constant for a part of the
- window. Experiment with what field changes what aspect.
-
-
- WindowType (Type) TGK_WIN
- ──────────────────────────────────────────────────────────────
- WindowType = Record
- { Loads-o-Junk }
- Buttons : Array[1..MaxButtons] Of ButtonType;
- End;
-
- This type is used to describe a complete window. Only the
- Buttons field is of interest to the user. For more information
- on what you can do with this field, have a look at ButtonType.
-
-
- WireColor (Procedure) TGK_3D
- ──────────────────────────────────────────────────────────────
- WireColor(Color:Byte);
-
- Sets the color to be used to "connect-the-dots", when drawing
- vector-objects on screen with DrawObjectWireFrame.
-
-
- XorLine (Procedure) TGK_GP
- ──────────────────────────────────────────────────────────────
- XorLine(X1,Y1,X2,Y2:Integer; Pa:Word);
-
-
- Draws an inverted line from (X1,Y1) to (X2,Y2) on page [Pa].
- Will either clip to the current viewport or not, depending on
- the current setting of LineClipping.
-
-
- XorPixel (Procedure) TGK_GP
- ──────────────────────────────────────────────────────────────
- XorPixel(X,Y:Integer; Pa:Word);
-
- Inverts the value of the pixel at coordinates (X,Y) on page
- [Pa]. Clips to the current viewport.
-
-
- XorRectangle (Procedure) TGK_GP
- ──────────────────────────────────────────────────────────────
- XorRectangle(X1,Y1,X2,Y2:Integer; Pa:Word);
-
- Draws an inverted rectangle on page [Pa]. The coordinate-pair
- (X1,Y1) denotes the upperleft corner of the rectangle, whereas
- (X2,Y2) denotes the lowerright corner. Clips to the current
- viewport.
-
-
- XorSquare (Procedure) TGK_GP
- ──────────────────────────────────────────────────────────────
- XorSquare(X1,Y1,Size:Integer; Pa:Word);
-
- Draws an inverted square on page [Pa]. The coordinate-pair
- (X1,Y1) denotes the upperleft corner of the square, whereas
- (X1+Size,Y1+Size) denotes the lowerright corner. Clips to the
- current viewport.
-
-
- Yes (Constant) TGK_WIN
- ──────────────────────────────────────────────────────────────
- Yes = True;
-
- May be used to test the result of a call to QuestionWindow for
- a positive answer. Alas, it makes your code look neat, but
- there is no further function... 8-)
-
-
- ZeroLine (Procedure) TGK_GP
- ──────────────────────────────────────────────────────────────
- ZeroLine(X1,Y1,X2,Y2:Integer; Color:Byte; Pa:Word);
-
- Draws a line from (X1,Y1) to (X2,Y2) on page [Pa], using color
- [Color]. Pixels will only be drawn if they had a previous
- value of 0. Thus, pixels will be put "behind" existing data
- only. Will either clip to the current viewport boundaries or
- not, depending on the setting of LineClipping.
-
-
- ZeroPixel (Procedure) TGK_GP
- ──────────────────────────────────────────────────────────────
- ZeroPixel(X,Y:Integer; Color:Byte; Pa:Word);
-
- Puts a pixel at the coordinates (X,Y) on page [Pa], using
- color [Color], only if this pixel had a previous value of 0.
- Thus, pixels will be put "behind" existing data only. Will
- clip to the current viewport boundaries.
- Appendix A: Keyboard Scancodes
-
-
- When using the G∙A∙M∙E-keytable to check whether a key is
- currently being pressed, here are the various scan-codes you
- will need to use. Please take notice that a typical key can
- create different characters, such as "4" and "$" or "q" and
- "Q", depending on whether a shift-key is pressed. Thus, when
- "1" is pressed, Keytable[$02] is true and when "!" is pressed,
- Keytable[$02] and either Keytable[$2A] or Keytable[$36] are
- true. Allright, here are the scancodes:
-
- "A" - $1E "H" - $23 "O" - $18 "V" - $2F
- "B" - $30 "I" - $17 "P" - $19 "W" - $11
- "C" - $2E "J" - $24 "Q" - $10 "X" - $2D
- "D" - $20 "K" - $25 "R" - $13 "Y" - $15
- "E" - $12 "L" - $26 "S" - $1F "Z" - $2C
- "F" - $21 "M" - $32 "T" - $14
- "G" - $22 "N" - $31 "U" - $16
-
- "1" - $02 "6" - $07 F1 - $3B F6 - $40
- "2" - $03 "7" - $08 F2 - $3C F7 - $41
- "3" - $04 "8" - $09 F3 - $3D F8 - $42
- "4" - $05 "9" - $0A F4 - $3E F9 - $43
- "5" - $06 "0" - $0B F5 - $3F F10 - $44
-
- "-" - $0C "=" - $0D "[" - $1A "]" - $1B
- ";" - $27 "'" - $28
- "," - $33 "." - $34 "/" - $35
-
- "Space" - $39 "~" (tilde) - $29
- "|" - $2B "Escape" - $01
- "Backspace" - $0E "Ctrl" - $1D
- "Left-shift" - $2A "Caps-Lock" - $3A
- "Scroll-Lock" - $46 "Tab" - $0F
- "Enter" - $1C "Right-shift" - $36
- "Printscreen" - $37 "Alt" - $38
- "Home" - $47 "Up arrow" - $48
- "Page up" - $49 "Minus" (keypad) - $4A
- "Left arrow" - $4B "Middle" (kpad-5) - $4C
- "Right arrow" - $4D "Plus" (keypad) - $4E
- "End" - $4F "Down arrow" - $50
- "Page down" - $51 "Insert" - $52
- "Delete" - $53 "Num-lock" - $45
-
- F11 - $D9
- F12 - $DA